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:

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

iframe to include

Go to End

11 Posts   4271 Views


Community Member, 21 Posts

22 January 2009 at 5:33am

Hey all,

I am developing a site and my client wants music to play in the background. I looked up every possible way but i couldnt eventually avoid it. Im going to have to use iframes. I know i know ill have SEO problems but i have no other choice.

Can someone tell me where to set it up?
Its probably going to be a new template, where inside its going to load any other .ss page .
Anyone done this before?

Thanks in advance,


Community Member, 21 Posts

28 January 2009 at 11:18pm



Community Member, 712 Posts

29 January 2009 at 9:12am client wants music to play in the background.

Oh god.. I'm sorry for you. That sort of thing should be illegal :D

So is the iframe purely for playing music? In which case, you just add the iframe to your normal template, but the src of the url will point to a special silverstripe page with is a very cut-down template, or even a static page (depending on how your client wants to control the music).


Community Member, 21 Posts

29 January 2009 at 9:21am

lol seriously music should be banned from websites!

basically what i need is to include the main into another ss, lets say in which will include the .ss that will play the music and the . just wondering where is the implementation being made.


Community Member, 712 Posts

29 January 2009 at 10:28am

Edited: 29/01/2009 10:29am

An iframe pulls data from another html page on the client side.

So in your you might have:

<iframe src=''>

(apologies if 'src' is the wrong tag - I don't use iframes much)..

so the client will request Then you just have to make sure that produces [a new, seperate] page that plays the music. This might be a special page you have set up in SilverStripe (independant of the first page), or a static page.

If your /music page is of type 'FramePage', you can let is use which is a simple template that plays music.


Community Member, 21 Posts

29 January 2009 at 10:41am

yea i already knew that part. whats tricky is that i need continuous playback of the music throughout the browsing of the site. thats why i said i need and to be included in

you know what i mean?


Community Member, 712 Posts

29 January 2009 at 1:43pm

Edited: 29/01/2009 1:48pm

(note: I really try to be one of those people who provide useful answers, even when the end goal might be something I personally disagree with, but this is a special case. Background music on websites is like ie6 - to be avoided like the plague and exterminated where it has somehow retained a foothold. Please don't do it, I beg you. And if the client insists, make sure that you've informed them that they are fully informed as to the dire consequence of their actions before you do anything. In fact, find a website that has music in the background and take them to it, and see if they still want to do it.)

That won't help - when you go to a new page it will still have to reload the music, play, etc. Templates are compiled server-side, but if the client requests a new page, it's still a whole new page as far as the browser is concerned.

Any solution for allowing music to play continuously (ie, unbroken) while the user navigates the site is going to be heinous. For example, you could.

1. Use a frameset (yikes!), where one frame is effectively hidden and has the music playing away, the other frame has your content. Then, whenever the user clicks an internal link, the target for the link is that frame. The music frame is never reloaded.

2. Make the entire thing ajaxy (lots of work, hard to do right, requires javascript), so that content is injected into the DOM without changing the page

3., can't think of anything else. (A POPUP window?? I won't even put it forward as a solution).

Both options kill usability (by making it nigh on impossible for users to bookmark pages) and SEO (can't find dynamic content, plus, pages found by search engines will tend NOT to be in the frame, so those links won't have the music). Additionally, option 1 is just bad programming and option 2 takes a lot of work, knowledge and potentially opens up lots of hairy security issues.

In summary:

  • it would be difficult (ie, time consuming = expensive) to do,
  • users will hate it,
  • it will kill the website as far as search engines go,
  • and even if it was easy, you wouldn't be able to sleep at night for the shame of it.
There are a lot of bad design elements that a web developer can knowingly or unknowingly include into his or her website template… some due to persistent request from their clients...

It can significantly slow down your website loading time, Most Internet users dislike anything that starts automatically, Most Internet users already have music playing, Even if you’re in the music business, a user would prefer to read about your services and company first before listening to your sample tracks, Your website users may not share your taste in music but they might like your contents... (and so on)
"Before you start, you should be aware that background music that automatically starts playing when a web page is loaded may not be appreciated by a large number of your visitors. Some of them, when greeted with the sudden blaring of music from their speakers, may immediately hit the BACK button of their browsers. This may occur even if you're playing a piece of music that you think is well loved by everyone: remember, there are people who surf the Internet in public libraries, at work, or in the dead of the night when others are asleep. Others may already have their favourite piece of music playing on their computer speakers, and your auto-playing music file will only cause them to be annoyed."



Community Member, 21 Posts

29 January 2009 at 10:52pm

I totally agree with you. If i could change their mind i would !

Thanks alot for the reply. I think ill tell them about framesets and the disadvantages of them. their choice. ill just...cry!


Go to Top