5102 Posts in 1520 Topics by 1116 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1226 Views |
-
Sorting CMS SiteTree

13 January 2011 at 4:37am
I searched all Forum but couldn't find this answer.
---
1º - When we click to create a new item in CMS, it automatically got created in the end of the list. This is really really bad when u got a bunch of articles and need to scroll down a lot to find it. Is there any way to the new item be created in the FIRST of the list, and not last?
---
2º - I have been trying to use this command in some controllers:
static $default_sort = "Created DESC";
The main objective is just to sort a specific list i need.
But it just brings no effect, tried to use Created, Title and others default rows... but never works (SilverStripe 2.4.4).So, i made the hard decision to force it in "_config.php" using:
SiteTree::$default_sort = "Created DESC";
OK, it works fine, but i got all the tree sorted.
How can i do a specific sort in a specific page i need?
---
I'm trying to avoid change SilverStripe core, always using its own parameters.
Sorry my bad english guys, i'll would be grateful for your help. -
Re: Sorting CMS SiteTree

18 January 2011 at 6:14pm
I have been trying to use this command in some controllers:
It shouldn't be in the controller, this is a model level variable. So try setting public $default_sort = "Created DESC"; on your subclassed model.
-
Re: Sorting CMS SiteTree

19 January 2011 at 2:43am
I made it, but $default_sort just don't work (and every topic says the same).
The main objective is sort the CMS Tree, but the only way possible right now is editing "_config.php".Can you give a look?
-
Re: Sorting CMS SiteTree

15 February 2011 at 2:30am Last edited: 15 February 2011 2:36am
I just figured out there's no solution for truly sort the tree.
So i used pter's magic module called "hidepages" ( http://www.silverstripe.org/customising-the-cms/show/11471?start=32#post293932 ) that can make your own rules to sort the list.
I really think SilverStripe could use this options in "$defaults" but it can't yet.
Hope this can help other people.
| 1226 Views | ||
|
Page:
1
|
Go to Top |


