1
votes

I have a structure in my sitecore content tree

  • Content Type A (Class 1)
    • Content Type B (Jane)
    • Content Type B (Alex)
    • Content Type B (Liam)
  • Content Type A (Class 2)
    • Content Type B (Bob)
  • Content Type A (Class 3)
  • ....

I then display all Content Type B in a Checkbox List as the source for a field in another template (essentially picking related content) this works but I now need to display it in alphabetical order regardless of which Content type A content it is under ie display

  • Alex
  • Bob
  • Jane
  • Liam

rather than

  • Alex
  • Jane
  • Liam
  • Bob

I can't see any mention of syntax in the sitecore query that supports that type of ordering. Does anyone have any ideas?

3

3 Answers

0
votes

If you get the list of Sitecore items through .NET you should also be able to do something like YourListOfItems.OrderBy(i => i.Name).

You can get the list of items by using Sitecore.ContentSearch in Sitecore 7 and up, or your Sitecore query as you normally would.

0
votes

try this option,

In the standard value of your "Content Type B" Template

puts this value: $name in your "Sort" Field

so, now your items should be sorted by name. and logically all values should be sorted in your checkboxList

0
votes

You can use .net method to do this

var newList = people.OrderBy(x=>x.NameCategory).ToList();