IÃ‚Â´m new to SilverStripe. Thanks for this pretty work!
Based on the tutorial 2 "Extending a basic site" iÃ‚Â´m trying to make a News page type.
The difference between my news page type and the page type in this sample is that i need to have different news types.
So, in the database definition i put this:
static $db = array
'Date' => 'Date',
'Author' => 'Text',
'Type' => "Enum('Type1,Type2,Type3,General','General')"
It works good. The database is created without problems.
The problem comes with the getCMSFields function.
I need to select one of the news types when i write a new, so my getCMSFields looks like this:
$fields = parent::getCMSFields();
$fields->addFieldToTab('Root.Content.Main', new CalendarDateField('Date'), 'Content');
$fields->addFieldToTab('Root.Content.Main', new TextField('Author'), 'Content');
$fields->addFieldToTab('Root.Content.Main', new ListboxField('Type'), 'Content');
I use ListboxField and, when i write a new news page i expect to have a combo with the options: Type1, Type2, Type3 and General. But i only have an empty combo.
What iÃ‚Â´m doing bad?
Thanks in advance and excuse me for my poor english.