Hi UncleCheese
Thanks for a quick update. I installed it and here is some feedback/questions.
I noticed that allow_asset_override is set to false per default in _config.php - however this just turns the dataObjectManager completely off in the Files & Images. Why? I just turned it back on with 'true'.
The updateCMSFields function now works, however doing a SimpleTreeDropdownField returns a simple textfield with the ID in it... Here is my code for the extended class:
class ExtendedImage extends Extension
{
public function extraStatics() {
return array(
'db' => array(
'Kategori' => "Enum('Billede, Link')",
'SiteLinkID' => 'Int'
),
'has_one' => array(
'SiteLink' => 'SiteTree',
'BilledeThumb' => 'Image',
),
);
}
public function updateCMSFields(FieldSet &$fields) {
$fields->push(new DropdownField('Kategori','Kategori', singleton('File')->dbObject('Kategori')->enumValues()));
$fields->push(new SimpleTreeDropdownField('SiteLinkID','Vælge en side (hvis kategorien er et link)'));
$fields->push(new FileIFrameField('BilledeThumb'));
return $fields;
}
}
The last thing. In mysite/_config.php I've written:
Object::add_extension('File', 'ExtendedImage');
Now this works, the problem is that the extended class also shows up when I click on folders. See this photo which explains:
I tried to change it to:
Object::add_extension('Image', 'ExtendedImage');
But with no luck, silverstripe just returns an error...
Ok, I know, many question, but hope you can help. Thanks again.
Joel