Is there any way to have an article list (ie; on an ArticleHolder page) displayed so it's sorted in chronological order with most recent articles displayed at the top?
...other than manually sorting the pages by dragging and dropping them up the list in the CMS
We've moved the forum!
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
Assuming you are talking about... http://doc.silverstripe.org/tutorial:2-extending-a-basic-site
something like this in your controller...
function ArticlesOrderedByCreated() {
return DataObject::get("ArticleHolder","","Created ASC");
}
then this in your controller...
<% if ArticlesOrderedByCreated %>
<% control ArticlesOrderedByCreated %>
$Date <br />
$Author <br />
$Content <br />
<% end_control %>
<% end_if %>
every dataobject (including pages or anything you create) has a "Created" and "LastEditted" value set automatically when you create it and when you edit it.