New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
$default_sort on pages beneath SiteTree class has no effects at all #848
Comments
It does, you just need to be getting instances of that class rather than SiteTree (so |
So it shall not effect the page's order in the CMS SiteTree? As example: I would like to sort pages by Date for a Blog. The pages should be displayed by test in the CMS SiteTree so that the newest is shown first. |
You can override |
Sounds good. How to achieve to put the latest created page on top without loosing the ability to sort manually by drag and drop? Right now I have this code inside onBeforeWrite() but it's not executed each time I create a page, what's really wired... if(!$this->FirstSort) { I think having the ability to add new pages on top or bottom of its siblings should be an easy to handle option of SilverStripe CMS core. |
Ok, Sort starts with 1 not with 0. Got that. Now I just need to find out how to write back the new Sort value for all other objects. |
I can change the value inside SiteTree model, but when I try to give subpages a default sort, the variable $default_sort has no effect.
The text was updated successfully, but these errors were encountered: