I am trying to add a tab to a page type called "Files", that will allow the user to upload a PDF (just one) that will attach to the page, so I can access it and place a link to it in a certain box in my .ss files.
class Tour extends Page {
static $db = array(
);
static $has_one = array(
'PDF' => 'File'
);
function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab( 'Root.Content.Files', new FileIFrameField('PDF', 'Upload and Attach Dossier PDF') );
return $fields;
}
1. This code displays an "Attach Image" Iframe, which is a little confusing
2. When a file is selected (a pdf) and "attach image" button is hit, page refreshes but nothing happens. No Mime Type image (not sure if there should be) and no confirmation.
3. File is present in Assets directory under "Uploads"
4. There is no link to the file in the Database, and accessing it from the template gives nothing.
Any help please. There is only two other posts on this forum, one has very similar code to what I have above, and claims that it works. The other simply wasn't answered. The docs tell me nothing.
Cheers
Aaron