We were working on one scenario where we had used Branch template and the item had presentation details (layout and renderings) applied on Standard Values where we had used Datasource (items from the hierarchy itself) on the renderings. But when we created items based on this branch template, the datasource path was still pointing to Branch template one.
I will quickly show the scenario using screenshot.
- $name item under Press Release branch with Presentation details using Datasource for Carousel rendering and datasource as the folder under $name.
- And at item level (created based on Press Release branch template) the datasource path is referring to branch template’s child.
The datasource path at item level should have reference to the folder under the item and not to the branch template.
While doing some R&D, we found the Branch Presets by Kamsar which came to our rescue. This solution fixes the bug we have faced.
The Steps to use the Branch Presets:
- Download the zip from the Github from the above link.
- Extract and open the solution in visual studio.
- Build the solution, it will fail since it is missing the reference to Sitecore.
- Install the Sitecore.Kernel from the Nuget packages (Select previous version (8.2.x) as the Branch Presets solution is built on 4.6 .Net framework).
- Build the solution again.
- Copy the BranchPresets.dll from bin to the Sitecore instance bin.
- Copy the z_Client folder to App_Config\Include folder from Sitecore instance.
And you are done. Just reload the Sitecore instance and check if the datasource path is fixed.
Thank you.. Keep Learning.. Keep Sitecoring.. 🙂