Jump to:

22977 Posts in 11720 Topics by 2826 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, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 214 Views
  • simples
    Avatar
    Community Member
    76 Posts

    When adding a page in the CMS I would like the page to appear at the top Link to this post

    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.

  • simples
    Avatar
    Community Member
    76 Posts

    Re: When adding a page in the CMS I would like the page to appear at the top Link to this post

    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.

    214 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.