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

iframe to include page.ss


Go to End
Reply


11 Posts   3138 Views

Avatar
shox

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,
shox

Avatar
shox

Community Member, 21 Posts

28 January 2009 at 11:18pm

anyone?

Avatar
Hamish

Community Member, 712 Posts

29 January 2009 at 9:12am

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

Avatar
shox

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 Page.ss into another ss, lets say FramesPage.ss in which framePage.ss will include the .ss that will play the music and the Page.ss . just wondering where is the implementation being made.

Avatar
Hamish

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 Page.ss you might have:

<iframe src='mysite.com/music'>
</iframe>

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

so the client will request mysite.com/music. Then you just have to make sure that mysite.com/music 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 FramePage.ss which is a simple template that plays music.

Avatar
shox

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 page.ss and playerpage.ss to be included in framepage.ss.

you know what i mean?

Avatar
Hamish

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. ...no, 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.

[url]http://www.pixaworks.com/juice/2008/bad-design-music/[/url]
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)

[url]http://www.thesitewizard.com/webdesign/backgroundmusic.shtml[/url]
"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."

etc.

Avatar
shox

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