Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-02-24 16:27:32

voodoo6
New Member
Registered: 2005-09-25
Posts: 5

open internal links in a pop up window

hi all

quick version:
“how can i open a section in a pop up window?”

long, drawn out version:

i would like a link on my home page to open a popup window containing an mp3 player.
the idea is to be able to listen to tracks in the player while reading and commenting on articles about the tracks at the same time and in the same window below the player.

I figure i need frames (i know, frames are evil, but i can’t think how else to do it!) as i want the music to continue playing if the user clicks, for example, a comments link and forces the page to reload.

i have a section named musicplayer which contains the articles about the music in the player.

(note. my php and javascript skills are very poor, i am essentially a designer with cut & paste style php and javascript skills!)

i suppose i need something that would provide this kind of functionality :
<div id="playerlink" onclick="popup_window('<txp:article form="article_music" limit="5" />','','status=yes,scrollbars=yes,width=470,height=470')">

i thought of using the <txp:zem_prblock> plugin mentioned in the faq about opening links in new window ,but this seems to relate only to new windows as opposed to popup windows. i did find this where zem says at the very bottom:

zem said: I suppose you could also use PR Block to add an onClick event to links. If someone wants to nut it out, or provide some other solutions, I’ll add them to the FAQ.

but no new solutions have been added to this post :-( and i can’t find much other info from searching.

i suppose i could just have the whole thing open in the main window, but i don’t want all the browser chrome and i wanted the users to be able to listen to music while viewing other articles in the main site if they wanted to (not just the music section articles). and also, the nature of the player/music discusser is kind of like an ‘add-on’ or ‘side-topic’ to the main site and not directly related, so seems more logical for it to exist in an optional pop-up.

okay, thats it. i hope it it makes sense and apologies if i’ve missed something really obvious – i’m pretty new to textpattern and it wouldnt be the first time i’ve missed a fundamental txp concept!

thanks in advance
mat

Offline

#2 2006-02-24 16:45:15

Jeremie
Member
From: Provence, France
Registered: 2004-08-11
Posts: 1,578
Website

Re: open internal links in a pop up window

You don’t need frame. Frame are evil.

Offline

#3 2006-02-24 16:58:51

voodoo6
New Member
Registered: 2005-09-25
Posts: 5

Re: open internal links in a pop up window

thanks Jeremie :-)

i agree, frames are the work of the devil himself, but.. got any ideas how else can i achieve the same effect? : a player on top that will not reload/restart the music each time a user clicks a link in the article.

Offline

#4 2006-02-24 17:10:14

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: open internal links in a pop up window

Create the new page to be used for your player, and assign it to your section. Then find the url to your section.

iframe:

<iframe src="link-to-section" name="music-player" width="470" height="470">
<a href="link-to-section" onclick="popup_window(this.href, 
'music-player', 'status=yes, scrollbars=yes, width=470, height=470'); 
return false;">listen to music</a>
</iframe>

popup

<a href="link-to-section" onclick="popup_window(this.href, 
'music-player', 'status=yes, scrollbars=yes, width=470, height=470'); 
return false;">listen to music</a>

iframe with popup backup

<iframe src="link-to-section" name="music-player" width="470" height="470">
<a href="link-to-section" onclick="popup_window(this.href, 
'music-player', 'status=yes, scrollbars=yes, width=470, height=470'); 
return false;">listen to music</a>
</iframe>

(I had to add a couple line breaks above, so the code would display properly.)

Last edited by Mary (2006-02-24 17:11:07)

Offline

#5 2006-02-25 11:49:03

voodoo6
New Member
Registered: 2005-09-25
Posts: 5

Re: open internal links in a pop up window

mary, thank-you

it really nice when somebody like yourself simplifies things for somebody learning, like me. as often happens, my head seems to over complicate matters which shouldn’t be so complicated! the help is really appreciated.

mat

Offline

Board footer

Powered by FluxBB