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.

Customising the CMS /

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


Reply


5 Posts   1052 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