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:

Template Questions /

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

Select SWF for header


Go to End


790 Views

Avatar
WaaaghNL

Community Member, 4 Posts

10 February 2012 at 12:46am

Hello all,

i have a little problem on my mind. a time ago did i intergrade a option for a customer that he can upload an image on every page for the header.

there for did i need to edit the mysite/code/page.php and add this

public static $has_one = array(
'HeaderImage' => 'Image'
);

function getCMSFields() {
$fields = parent::getCMSFields();

if(!$this->Parent){
$fields->addFieldToTab("Root.Content.Main", new ImageField('HeaderImage'));
}

return $fields;
}

in the template file i only had to set $HeaderImage.

Now i want te make it work for an Flash animation but changing "'HeaderImage' => 'Image'" to "'HeaderImage' => 'Flash'" Or SWF, wont work.
is there someone who can help me with this?

Thanks
Ronald