Branch Templates have been around in Sitecore for several versions (officially called Branch Templates since Sitecore 6, I believe). And even looking at Sitecore Branch Template documentation, you will notice that it is specifically set under the Developer section.
However, in my experience and once development creates the page template, a content author is completely capable of creating branch templates themselves. Content authors and marketers are the primary users of branch templates to create pages of content more quickly. They even work with UI/UX teams to determine the best renderings for a page and styling based on the design. So why not let content authors have a little more control over the content and at the same time, free up development to focus on more techy tasks?
While working with a client recently, development was asked to create the branch templates for a new site. Having experience previously building branch templates, I offered to take on the task! It surprised the developers and content authors working on the project; the latter asked to shadow while going through the steps (outlined below) to create the branch templates.
The branch template was for a resource center asset page. This is an ideal candidate as the design has the same layout and renderings on every page but only the content and imagery change between. A developer had created the page template for the asset type including sections and fields in addition to setting the header and footer on the standard values. From here, creating the branch template is pretty straightforward.
Building Sitecore Branch Templates
-
-
-
From inside Content Editor, open the Templates node followed by the Branches node.
-
-
If you cannot see the Templates nodes, click the View tab in the Ribbon and check “Entire Tree” and “Hidden Items”. Sitecore will reload and add extra nodes to the content tree (unless explicitly restricted by an admin).
-
-
-
Once expanded, either right-click the folder where the new branch template should be set or right-click to insert a new Branch Folder.
-
If you are creating branch templates for a new site, it is best practice to group them using branch folders.
-
-
After determining or creating the branch folder, right-click on the folder to Insert > New Branch.
-
The Create a new branch window will pop up and ask you to choose the page template on which to base the branch. Navigate to and select the page template created by development.
-
Clicking the create button will, you guessed it, create the branch template.
-
-
While you created the branch template item, it is pretty much just a copy of development’s page template; now comes the real creation of the branch template.
-
-
-
Click on the subitem below the branch template named $name and open the page in Experience Editor.
-
Now build the page how you normally would based on the design.
-
When the page has the basic layout and components set up how you want, click Save.
-
Congrats! You have now built a branch template! Any new page created from this branch will be a customizable copy of the template with components. All to update then is the content specific to the page.
-
-
Some important considerations
-
-
Adding Sitecore Branch Templates as an Insert Option in the Content Tree
-
After creating the branch, navigate the content tree and click on the page that items created from this branch will be inserted below.
-
On the item, scroll down to the Insert Options section.
-
Click Edit under Insert options, choose the branch template just created and click OK then Save.
-
Now, when someone right-clicks on this page to insert a new page, the branch template will be an available option.
-
-
TDS/Source Control
-
If your Templates node is saved in TDS/source control, the changes could get wiped out when a deployment occurs.
-
Copy the Sitecore path of the branch and ask a developer to package it up to check-in to save the changes. (More on creating packages in Sitecore in another post!).
-
-
Again, content authors often have to rely on development to do a lot, like branch templates when they are normally capable of creating them. Hopefully through this post, more content authors will get more involved in the template and branch template creation process. If you would like to chat more about Sitecore, branch templates or something related, feel free to comment below. You can always message me too on LinkedIn or Twitter @sitecorejo, and don’t forget to check out my author page for other Sitecore posts!