Using Sitecore 6.6 we are constructing some templates that inherit many base templates. This is great for reuse and standardizing our code, as all the fields are stored in a constants file for easy reference. However, we seem to be unable to define the order that these inherited templates are displayed.
The templates seem to be sticking to the original order they were added in no matter what. We've tried using the sortorder on the actual base templates themselves, but that doesnt appear to work. Likewise with just reordering the templates in the __Base template field picker.
Any ideas?
I have found that sorting template sections and fields often works best when using negative numbers. Strange but true.
That is a great approach for templating. To reorder the fields/fieldsets set the sortorder of the Template Fields and Template Sections themselves inside of the inherited templates.
I have the same problem with sorting in template inheritance. I have been using a combination of negative and positive numbers, fixed this. Retro fitting does seem a pain and quite a lot of work though. Definitely something to think about upfront.
My experience is that fields are added based on the Sort Order of the section, and if two sections have the same value, then the fields are added from the child template first.
Suppose you have a template My New Template that inherits from the Sample Item, with a field in the Data section called My New Field. Even if My New Field has a sort order of 300, and Title and Text are 100 and 200, My New Field will come first if both Data sections are set to 100. To make it come after Title and Text, set the section Sort Order to a higher value, like 150.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With