Now I add photos to the FotoPage with DataObjectManager (Class Foto):
class Foto extends DataObject
{
static $db = array (
'Name' => 'Text',
'Description' => 'Text',
);
static $has_one = array (
'Attachment' => 'File',
'FotoPage' => 'FotoPage'
);
public function getCMSFields_forPopup()
{
return new FieldSet(
new TextField('Name'),
new TextareaField('Description'),
//new DropdownField('Category','Category', singleton('Resource')->dbObject('Category')->enumValues()),
new FileIFrameField('Attachment')
);
}
}
what should I do to use the module on different types of pages: FotoPage and NewsPage?
may be sufficient to fix the code only:
'FotoPage' => 'FotoPage'
on
'FotoPage' => 'Page'
?