Work with a branch template
You can create a branch template in several ways.
When a user creates an item using the branch template, Sitecore replicates all descendants of the branch template definition item before expanding tokens. These items contain a copy of the content, renderings, and so on, of the branch at the time the items were created - any changes applied to the branch template after the items were created do not automatically appear on the created items.
Create a branch template
To create a branch template:
-
In the Template Manager or the Content Editor, go to /Sitecore/Templates/Branches, right-click a folder and then click Insert, Branch Folder to create any required project-specific folders.
-
In the content tree, click the relevant project-specific folder and insert a new branch template definition item using the /System/Branches/Branch data template.
-
With the newly created branch template definition item selected, right-click and insert one or more items or hierarchies of items.
Create a branch template for a data template
You can insert a branch template containing a single item based on a specific data template.
To create a branch template for a data template:
-
In the Template Manager or the Content Editor, within /Sitecore/Templates/Branches, insert any required project-specific folders using the /System/Branches/Branch Folder data template.
-
Under the relevant project-specific folder, insert a new branch template using the /Branches/System/Branch/New Branch command template.
-
In the Create a New Branch dialog box, select the data template, and then click Create. Sitecore creates a new branch template definition item containing a single item named
$name
based on the selected data template.
By default, insert options for branch folders include the /Branches/System/Branch/New Branch command template, but not the /System/Branches/Branch data template.
Create a branch template by duplicating an existing item
You can create a branch template by duplicating one or more existing items or branches of items.
To create a branch template by duplicating one or more existing items:
-
In the Content Editor or the Template Manager, insert a branch template using the /System/Branches/Branch data template.
-
In the Content Editor, on the View tab, select the Hidden items check box to display the hidden items.
-
Select the item you want to duplicate to populate the new branch template.
-
On the Home tab, on the ribbon, in the Operations group, click Copy To.
-
In the Copy Item To dialog box, select the branch template, and then click Copy.
Sitecore copies the item or hierarchy of items to create a new item or hierarchy of items under the branch template definition item.
-
Optionally, on the View tab, clear the Hidden items check box to hide hidden items again.