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.

Customising the CMS

Pages order in menu/cms


12 Posts   4928 Views


25 June 2010 at 3:23am Community Member, 81 Posts

Try it =)
class ArticleHolder_Controller extends Page_Controller {

   * Get the latest 2 news articles, allowing us to get more
   * @return DataObjectSet|false The DataObjectSet of the news articles you're looking at or boolean false if there aren't any news articles
   function NewsArticles() {
      if(!isset($_GET['start']) || !is_numeric($_GET['start']) || (int)$_GET['start'] < 1) $_GET['start'] = 0;
      $SQL_start = (int)$_GET['start'];
      $doSet = DataObject::get(
         $callerClass = "ArticlePage",
         $filter = "`ParentID` = '".$this->ID."'",
         $sort = "Date DESC",
         $join = "",
         $limit = "{$SQL_start},10"
      return $doSet ? $doSet : false;


Terry Apodaca

23 February 2011 at 8:49am Community Member, 109 Posts

I've tried several of these, and a few of my own. I have to say that they are all very inconsistent. VERY I just tell the client that the menu will show up in the same order it does in the tree of the CMS. If they want it changed, they can click the Drag and Drop Reordering to place them in the order they want. so my sort is empty:

static $default_sort = '';


25 September 2012 at 11:00pm Community Member, 8 Posts

Did any body find an answer to this? been rattling my brain with this problem!
If so could you please post


30 April 2013 at 3:50am Community Member, 1 Post

[url=]This thread[/url] put me on the right track (I'm using SS 3). Open your site's _config.php file and add the following line:

SiteTree::$default_sort = 'Title';

Replace Title with whatever column you want to sort the tree on.