hi,
I just finished the tutorials and now I´m stuck with my news page. I want to have multiple pages from which the main homepage-news should get the newest articles. at the moment, it only gets the 5 newest articles from the articleHolder and ArticlePage pages. I think, I have to modify the homepage.php, at the moment it looks like this:
<?php
/**
* Defines the HomePage page type
*/
class HomePage extends Page {
static $db = array(
);
static $has_one = array(
);
static $icon = "themes/tutorial/images/treeicons/home";
}
class HomePage_Controller extends Page_Controller {
function LatestNews($num=5) {
$news = DataObject::get_one("ArticleHolder");
return ($news) ? DataObject::get("ArticlePage", "ParentID = $news->ID", "Date DESC", "", $num) : false;
}
}
?>
I was thinking to just add another function but I don´t know if that would work. Also, it always should get the 5 newest from all categories/pages, not from each page.. could someone help me with this?