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.

Template Questions /

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

Select SWF for header


Go to End


1128 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