21282 Posts in 5730 Topics by 2601 members
General Questions
SilverStripe Forums » General Questions » When adding a page in the CMS I would like the page to appear at the top
General questions about getting started with SilverStripe that don't fit in any of the categories above.
Moderators: martimiz, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 122 Views |
-
When adding a page in the CMS I would like the page to appear at the top

11 September 2012 at 6:19am Last edited: 11 September 2012 6:03pm
Hi,
When I add a new page in the CMS, I would like the newly added page to go to the top of the list in the tree view. At the moment it goes to the bottom.
I have downloaded the DOM in which I see there is a SortableDataObject module. However I am looking for a lightweight solution and suspect that there is a lot of code in this module which is not needed for this particular issue.
Does anyone know of a lightweight solution?
Simply adding
static $default_sort = 'Sort DESC';
or
static $default_sort = 'ID DESC';
beneath the line
class Page extends SiteTree{
in mysite/code/page.php
does not appear to work after I rebuild the database and flush the CMS page.
The new page still gets added to the bottom.
I hope I do not have to instruct my client to drag and drop every page.
Apologies if I have overlooked something obvious here.
Thanks.
PS. I am using Version 2.4 because my client is stuck with hosting which only supports PHP 5.2.
-
Re: When adding a page in the CMS I would like the page to appear at the top

11 September 2012 at 9:00am Last edited: 11 September 2012 6:04pm
Hi,
Please note that I am not looking for a different sort capability here as such. All I really want to do is make the newly added page in the CMS appear at the top of the existing list of pages rather than at the bottom. I still want to be able to use drag and drop in the CMS. As done currently, I need the pages in the front-end menus to appear in the same order as they appear in the back-end CMS treeview.
Thanks.
| 122 Views | ||
|
Page:
1
|
Go to Top |

