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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

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   1370 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