Jump to:

23355 Posts in 17702 Topics by 2862 members

General Questions

SilverStripe Forums » General Questions » SiteTree Sort Order

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 246 Views
  • Steeloctopus
    Avatar
    Community Member
    4 Posts

    SiteTree Sort Order Link to this post

    Hi

    I have just started developing a Sliverstripe site using 3.1. I would like to modify the sort order of the site tree in the CMS,

    I have a PeoplePage object and I would like to sort this object in the tree in alphabetical order.

    All the other post explain how to do it in older versions can any body tell me how to do this in 3.1

    thanks

  • Willr
    Avatar
    Forum Moderator
    5482 Posts

    Re: SiteTree Sort Order Link to this post

    It should be the similar approach in 3.1 as per older releases. For your peoplepage object define the $default_sort variable

    private static $default_sort = "Title ASC";

  • Steeloctopus
    Avatar
    Community Member
    4 Posts

    Re: SiteTree Sort Order Link to this post

    OK I added the line

    private static $default_sort = 'Title ASC';

    Into my PeoplePage object but that has had no effect to the order. It is still overwritten by SORT in the CMS SiteTree. I have flushed the cache as well but with no success. I still get this order:

    Dominic underwood   
    Anablee the king
    Zoey fine
    Joey Blogs

    Where is should be
    Anablee the king
    Dominic underwood   
    Joey Blogs
    Zoey fine

    Am I doing something wrong. If I change this line in the SiteTree object then the whole SiteTree order is effected.

    private static $default_sort = "\"Title\"";

    I'm must be doing something stupid. can anyone help?

  • Willr
    Avatar
    Forum Moderator
    5482 Posts

    Re: SiteTree Sort Order Link to this post

    Potentially a bug within SilverStripe. AFAIK that should work from a theory point of few. If you can reproduce the issue on a clean 3.1 install it would be good to report it as an issue on github.com/silverstripe so it can be triaged / resolved.

    246 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.