Hi there
I currently have latest news on the homepage, which is great, i want it on another page as well.
I've created a custom page type with a Controller 'HomePageNoIntro.php' and a Template 'HomePageNoIntro.ss'
I've copied the code from HomePage.php and HomePage.ss and placed in the new pages.
Which creates the container, but no articles ... I'm sure the issue is in the Controller page :mysite/code/HomePageNoIntro.php
<?php
class HomePageNoIntro extends Page {
}
class HomePageNoIntro_Controller extends Page_Controller {
// ...
public function LatestNews($num=5) {
$holder = ArticleHolder::get()->First();
return ($holder) ? ArticlePage::get()->filter('ParentID', $holder->ID)->sort('Date DESC')->limit($num) : false;
}
}
Do i need a different function from the HomePage.php function? - i've tried just changing the function name (LatestNewsB) - and updating the template ... but this did nothing?
I'm confused - surely this must be simple?
Thanks for reading.