Hi All,
I'm using SS 3.2.1. I want all pages in my site to have a navigation colour. I'm doing this in my page code:
private static $db = array(
'NavColour' => "Enum('Red,Orange,Green,Blue,Pink,White','Red')"
);
function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab('Root.Content.Main', new DropdownField(
'NavColour',
'Navigation button colour',
singleton('Page')->dbObject('NavColour')->enumValues()
), 'Content');
return $fields;
}
This works great. I see the dropdown in the CMS and I see the database being populated. However, if I try to output this value in the template with:
<a href="#" class="$NavColour">Nav Item</a>
Nothing is printed... Is there a special way to output enum values?
Many thanks,
Lee