I want each page to contain a list of links, specific to that page. The problem with my code is that is displays the same links on every page.
Each set of links should only be displayed on the page that it was created for.
Page.php
$fields->addFieldToTab("Root.Content.Links", new DataObjectManager(
$this,
'FooterMenuItem',
'FooterMenuItem',
array('Link'=>'Link','Text'=>'Text'),
'getCMSFields_forPopup'
));
FooterMenuItem.php
class FooterMenuItem extends DataObject
{
static $db = array (
'Link' => 'Varchar',
'Text' => 'Varchar'
);
public function getCMSFields_forPopup()
{
return new FieldSet(
new TextField('Link'),
new TextField('Text')
);
}
}