Is there a way to reverse the order of the comments without editing the core code so that the newest comments are at the bottom?
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.
Not that I'm aware, but it would be a nice simple feature for managing from the cms.
\sapphire\core\model\SiteTree.php
Line 288
public function Comments() {
$spamfilter = isset($_GET['showspam']) ? '' : 'AND IsSpam=0';
$unmoderatedfilter = Permission::check('ADMIN') ? '' : 'AND NeedsModeration = 0';
$comments = DataObject::get("PageComment", "ParentID = '" . Convert::raw2sql($this->ID) . "' $spamfilter $unmoderatedfilter", "Created DESC");
return $comments ? $comments : new DataObjectSet();
}
I think changing "Created DESC" to "Created ASC" will do what you want.
Cheers
Aaron
I agree. I think it would be a nice simple feature for the cms.
That was the code I didn't want to edit, but looks like I don't have a choice. Oh well. Thanks for the response.
Chris