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.

Customising the CMS /

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

How do I create its type for fastening to my page of the files of the type swf


Go to End


5 Posts   1736 Views

Avatar
BangMan

Community Member, 7 Posts

13 May 2009 at 9:50am

I created its type of the page for banner, but how I add the field for loading most banner format swf?

Avatar
Carbon Crayon

Community Member, 598 Posts

3 June 2009 at 8:47pm

Hi BangMan

You can use a FileIFrameField for flash files.

Aram

Avatar
BangMan

Community Member, 7 Posts

3 June 2009 at 9:27pm

Like here?

class SWFPage extends Page {
static $db = array(
'Description' => 'Text',
);
static $has_one = array(
'Flash' => 'FileIFrameField',
);

function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab("Root.Content.Main", new FileIFrameField("Flash",_t('SWFPage.Flash','Flash'), "", $this));
return $fields;
}

Avatar
Carbon Crayon

Community Member, 598 Posts

3 June 2009 at 10:08pm

Almost, but your has_one should look like this:

static $has_one = array(
'Flash' => 'File'
);

Avatar
BangMan

Community Member, 7 Posts

4 June 2009 at 12:09am

Edited: 04/06/2009 12:10am

thank you, shall try so