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.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Add Flash to Page - but above Content box


Go to End


6 Posts   3048 Views

Avatar
Valorinbattle

Community Member, 95 Posts

26 February 2009 at 3:02pm

I'm trying to find a way to add a flash element to my homepage (HomePage.ss page type). I know how to add flash so that it shows up in the content box. But I'm trying to add it much as the ImageBanner is added so that it can appear above the content box.
ImageBanner isn't letting me upload a flash element. Is there another way of doing this?

~ James

Avatar
Sam

Administrator, 690 Posts

26 February 2009 at 4:33pm

You probably want to use a FileIFrameField rather than an ImageField.

Avatar
Valorinbattle

Community Member, 95 Posts

26 February 2009 at 4:36pm

Thanks Sam. Is there a tutorial that shows me how to add a FileIFrameField?

Avatar
mandrew

Community Member, 37 Posts

26 February 2009 at 6:29pm

Not really, but it works very similarly to the ImageField.

Avatar
Valorinbattle

Community Member, 95 Posts

28 February 2009 at 12:34pm

Okay, so I followed the tutorial about making a BannerImage and tried to adjust it for a FileIFrameField.
Three questions:

1. The tutorial says to add this:

static $has_one = array(
'BannerImage' => 'Image'
);

So would mine say:
static$has_one = array(
'FlashBanner' => 'Image'
);

or would there be something else in the place of 'Image'?

2. The field "FlashBanner" shows up in the CMS and prompts me to add a file either from my computer or the file store.
But when I add the .swf file, it does not show it in the CMS as it does when I add an image for BannerImage. So why doesn't it show up?

3. The flash banner does not show up on the actual site. It does however show me the name of the file. Why the name and not the actual flash element?

Any help would be awesome!

~ James

Avatar
silvernick

Community Member, 4 Posts

10 April 2009 at 3:00am

Maybe it is because a Flash file is not an image. It needs to be embedded with <embed> tags and it also takes a heap of other statements. I know it defeats the purpose of a CMS but if you're using it for your own web site (which will in all likelihood not even need a CMS) why not enter the HTML for your Flash straight into the template? (Until you know how to better integrate Flash into the template of course...)