Hey,
Im using the SiteTree to allow the user to choose a page on the site to create a link.
The Page.php has this code
public static $has_one = array(
"CaptionOneLink" => "SiteTree"
);
public function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab("Root.SliderText", new TreeDropdownField('CaptionOneLink', 'Caption 1 Link', 'SiteTree'));
return $fields;
}
The template file page.ss has the following:
<a href="$CaptionOneLink.Link">Link to page</a>
In the admin section I can see the dropdown, with the pages in their. However when I select one and save it display "(Choose One)" rather than the selected page name.
When I load the page there is no link in the <a> anchor tag. I checked the database and the ID it has entered for CaptionOneLink is 0.
Is there something I'm missing? Or Documentation you can link to?