Hi Silverstripers,
Somehow I can't find a way to get thisone working;
I extended Page with a has_many relation to multiple Files and overwritten getCMSFields to show an uploadfield in the CMS.
I use Silverstripe 3.02.
Everything looks fine in the CMS; users can upload one or more files on this page and the upload field automaticaly expands to handle more files to upload. All files have an edit- and an delete-button next to it. But somehow these buttons magicaly dissapear when the user saves & publishes the page. And they never come back.... :(
I looked everywhere on Google, but can't find anybody having the same problem.
A solution or workaround to this problem is highly appreciated!!
Anybody?
This is my code:
class pageWithDocs extends Page {
static $has_many = array(
'AttachedDocuments' => 'File'
);
public function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab('Root.Main', new UploadField('AttachedDocuments', 'Documenten', $this->AttachedDocuments()));
return $fields;
}
}