I'm trying to extract the most recent children of a Page instance called "Recent Success Stories" so that I can show the most recent 3 pages. The following 4 functions were extracted from this tutorial http://doc.silverstripe.com/doku.php?id=rssfeed under "Example of showing the 10 most recently updated
pages."
Could you please take a look and
A) verify that I'm doing this correctly, particularly noting the last comment +
B) explain a little about each function? I generally understand the functionality, but would very much appreciate some verbose explanation.
function recentSS() {
global $recentSS;
return $recentSS;
}
function init() {
RSSFeed::linkToFeed($this->Link() . "rss", "Recent Success Stories");
parent::init();
}
function rss() {
$rss = new RSSFeed($this->LatestUpdates(), $this->Link(), "Recent Success Stories", "Shows a list of the recent success stories.", "Title", "Content", "Author");
$rss->outputToBrowser();
}
function LatestUpdates() {
// 10 is the number of pages
return DataObject::get("Page", "", "LastEdited DESC", "", 10);
DataObject::get('VirtualPage', "ParentID != $this->ID", 'Date DESC', '', 3); // *** Is this correct?
}
}