5093 Posts in 1516 Topics by 1113 members
| Go to End | ||
| Author | Topic: | 3978 Views |
-
Re: Pages order in menu/cms

25 June 2010 at 3:23am
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;
}}
-
Re: Pages order in menu/cms

23 February 2011 at 8:49am
I've tried several of these, and a few of my own. I have to say that they are all very inconsistent. VERY inconsistent....so 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 = '';
-
Re: Pages order in menu/cms

25 September 2012 at 11:00pm
Did any body find an answer to this? been rattling my brain with this problem!
If so could you please post -
Re: Pages order in menu/cms

30 April 2013 at 3:50am
This thread 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.
| 3978 Views | ||
| Go to Top |



