Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Data Model Questions /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Uploading a Flash file (.swf) to a page


Go to End


4 Posts   1862 Views

Avatar
RonG

Community Member, 11 Posts

17 January 2011 at 6:32am

I created a new page type by extending Page. A requirement for the new page type is content editors to be able to add a Flash file (.swf).

I added the following code to the page type (ProjectPage), but now struggling with modifying getCMSFields() to add the field to a tab:

static $has_one = array(
'Photo' => 'Image',
'FlashHeader' => 'File'
);

Which FormField to use for uploaded files (not images) in addFieldToTab method?

Avatar
dhensby

Community Member, 253 Posts

17 January 2011 at 7:36am

Edited: 25/02/2011 11:00am

FileUploadField FileIframeField is probably your best bet.

Avatar
RonG

Community Member, 11 Posts

17 January 2011 at 8:00am

Where can I find information about FileUploadField?

The following results in an error ("Fatal error: Class 'FileUploadField' not found in ..."):

function getCMSFields() {

...

$fields->addFieldToTab("Root.Content.Main", new FileUploadField('FlashHeader'));

...

}

Avatar
dhensby

Community Member, 253 Posts

25 February 2011 at 11:00am

FileIframeField sorry :S