Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

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

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

SiteTree Sort Order


Go to End


5 Posts   2147 Views

Avatar
Steeloctopus

Community Member, 5 Posts

21 February 2014 at 4:46pm

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

Avatar
Willr

Forum Moderator, 5523 Posts

21 February 2014 at 8:58pm

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";

Avatar
Steeloctopus

Community Member, 5 Posts

24 February 2014 at 12:36am

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?

Avatar
Willr

Forum Moderator, 5523 Posts

24 February 2014 at 7:47pm

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.

Avatar
haugen

Community Member, 14 Posts

2 January 2015 at 10:06pm

Was this reported, or done something with?