Creating Items from branch template in Sitecore Programmatically

Branch Templates are mainly used to build the reusable collection of items, or the hierarchy of items. Branch templates are very useful in creating the same structure at any path in Sitecore. In this article, let’s look at Creating Items from branch template in Sitecore Programmatically.

Creating Items from branch template in Sitecore Programmatically

If we are automating the content for Multi-site or Localizing the site then we can make use of branch template and feed the content to Sitecore.

For Eg: Let’s say we have created a Product branch template and we need to create products under Sitecore home node.

Below is the C# code to create items using the branch templates in Sitecore.

This will add product-1 item under the home node and now we can fetch the product-1 item and edit the content accordingly.

 

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *