Hi,
I have my 'blog/news' entries working on the home page but I have also included a 'Featured Project' on the home page. This is showing up but no matter what number i put in (I only want one project to show) it displays all projects on the homepage.
Here is my code:
[ code]class HomePage_Controller extends Page_Controller {
function FeatureProject($num=1) {
$projects = DataObject::get_one("ProjectHolder");
return ($projects) ? DataObject::get("ProjectPage", "ParentID = $projects->ID", $num) : false;
}
function LatestNews($num=1) {
$news = DataObject::get_one("ArticleHolder");
return ($news) ? DataObject::get("ArticlePage", "ParentID = $news->ID", [ color=yellow]"Date DESC", "",[ /color] $num) : false;
}
}
[ /code]
Is the "Date DESC", "", necessary? When i include it in FeatureProject it comes up with an error. I don't have a date on my projects - is this related?
Any help would be appreciated.