Sort legacy templates

Using Sitecore 6.6, we create some templates that inherit many basic templates. This is great for reusing and standardizing our code, as all fields are stored in a constant file for ease of use. However, we cannot determine the display order of these inherited patterns.

The templates seem to adhere to the original order in which they were added, no matter what. We tried using sortorder on the underlying templates themselves, but this does not seem to work. Similarly, simply reordering the templates in the __Base template field collector.

Any ideas?

+4
source share
4 answers

This is a great approach for templates. To change the order of fields / fields, set the sort order of the template fields and template sections within inherited templates.

+5
source

I found that sorting sections and template fields often works best when using negative numbers. Surprisingly, a fact.

+8
source

I have the same sorting problem in template inheritance. I used a combination of negative and positive numbers, fixed that. Retro fitting really seems like a pain and a lot of work. Definitely something to think about in advance.

+2
source

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 first from the child template.

Suppose you have a My New Template that inherits from the Sample element, 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 be the first if both Data sections are set to 100. To do this after Title and Text, set the Sort Order section to a higher value for example 150.

+1
source

Source: https://habr.com/ru/post/1484980/


All Articles