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.

General Questions

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

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

Add Flash to Page - but above Content box


Reply

6 Posts   2329 Views

Avatar
Valorinbattle

26 February 2009 at 3:02pm Community Member, 95 Posts

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

26 February 2009 at 4:33pm Administrator, 679 Posts

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

Avatar
Valorinbattle

26 February 2009 at 4:36pm Community Member, 95 Posts

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

Avatar
mandrew

26 February 2009 at 6:29pm Core Development Team, 32 Posts

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

Avatar
Valorinbattle

28 February 2009 at 12:34pm Community Member, 95 Posts

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

10 April 2009 at 3:00am Community Member, 4 Posts

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...)