Hi
Im trying to create a front page (the first page, also called HomePage) that contains a selection of teasers (other pages).
Im currently able to select multiple pages from in the CMS, my problem is now how to retrieve these related pages on my frontpage.
I have tried with:
<% control ReferencedPages %>
Title: {$Title}
<% end_control %>
- but this doesnt work.
I have also tried in the controller:
$this->ReferencedPages()
..
and
...
foreach($this->ReferencedPages() as $item){
Debug::show($item);
}
- but also here no luck!
So right now Im pretty much all out of ideas.
I have pasted the models (excerpt) below.
Thanks!
class HomePage extends Page {
public static $has_many = array(
"ReferencedPages" => 'SiteTree'
);
...
$fields->addFieldToTab("Root.Content.Main", new TreeMultiselectField("ReferencedPages", "Choose page to show", "SiteTree"));
class Page extends SiteTree {
public static $has_one = array(
'HomePage' => 'Page'
);
...