Hello :)
I don't do a huge amount of SS developing (which is a shame really), so I'm hoping someone can shed some light on this.
I have a data object which is for a blog, and I have a blog page which obviously displays the blog posts. In the BlogPage file, in the controller, I have the following:
public function display() {
$params = $this->getURLParams();
$slug = $params['ID'];
$article = Blog::get()->filter(array(
'Slug' => $slug
));
$count = $article ? $article->Count() : 0;
if($count == 1) {
return array("Article" => $article);
} else {
$errorPage = DataObject::get_one('ErrorPage');
$this->redirect($errorPage->Link(), 404);
}
}
However, the following in the template simply doesn't work:
<% with $Article %>
$Slug - $Title - $Post
<% end_with %>
All of those are correct variables defined in the DataObject file, but they all output nothing. The page is correct (not seeing the 404), but still no blog details.
Any help appreciated :)