Sortorder of Inherited Templates
Asked Answered
R

4

5

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?

Regurgitate answered 7/6, 2013 at 6:39 Comment(0)
A
6

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.

Albumenize answered 7/6, 2013 at 6:54 Comment(1)
Thanks! Although the downside to this is that the sortorder is fixed no matter what template inherits from it, but I can definitely make due.Regurgitate
L
9

I have found that sorting template sections and fields often works best when using negative numbers. Strange but true.

Lunation answered 9/6, 2013 at 20:43 Comment(0)
A
6

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.

Albumenize answered 7/6, 2013 at 6:54 Comment(1)
Thanks! Although the downside to this is that the sortorder is fixed no matter what template inherits from it, but I can definitely make due.Regurgitate
Y
2

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.

Ymir answered 3/5, 2015 at 12:12 Comment(0)
C
1

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.

Chirp answered 1/5, 2015 at 14:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.