# iFrame links

**URL:** <https://www.ruby-forum.com/t/iframe-links/105365>\
**Category:** Radiant CMS\
**Created:** [May 29, 2007, 10:50am UTC](https://www.ruby-forum.com/t/iframe-links/105365 "2007-05-29T10:50:20Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![islepilot](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/ac8455/32.png) [@islepilot](https://www.ruby-forum.com/u/islepilot)\
**Post date:** [May 29, 2007, 10:50am UTC](https://www.ruby-forum.com/t/iframe-links/105365/1 "2007-05-29T10:50:20Z")

</div>

This isn’t really a radiant problem, but maybe one of you can help  
me. I have been forced to use iframes because the client wants music  
on the site. Now he wants links to specific pages, which of course  
poses a problem. Does anyone know how to generate a link directly to  
a specific page within an iFrame? The only solution I have heard of  
so far involved setting a php variable in the link, the reading this  
back out (the author of this idea assumed I was using php).

Any ideas?

Keith B.  
Tel: +49-7731-79838380  
removed\_email\_address@domain.invalid  
[http://keithbingman.com](http://keithbingman.com)

---

<div class="post-metadata">

**Author:** ![islepilot](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/ac8455/32.png) [@islepilot](https://www.ruby-forum.com/u/islepilot)\
**Post date:** [May 29, 2007, 4:16pm UTC](https://www.ruby-forum.com/t/iframe-links/105365/2 "2007-05-29T16:16:16Z")

</div>

On 29/05/07 05:48 AM, Keith B. was heard to say:

> This isn’t really a radiant problem, but maybe one of you can help  
> me. I have been forced to use iframes because the client wants music  
> on the site. Now he wants links to specific pages, which of course  
> poses a problem. Does anyone know how to generate a link directly to  
> a specific page within an iFrame?

Not sure I understand what you are asking, but opening a link into a  
different window is done with the “target” attribute of the tag.  
Example:  
 …

Oliver

---

<div class="post-metadata">

**Author:** ![islepilot](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/ac8455/32.png) [@islepilot](https://www.ruby-forum.com/u/islepilot)\
**Post date:** [May 29, 2007, 4:20pm UTC](https://www.ruby-forum.com/t/iframe-links/105365/3 "2007-05-29T16:20:17Z")

</div>

Yes. That is clear. I am trying to link directly to a page with an  
iFrame from an external link. Basically a bookmark. I think I know  
how to do it, but thought I see if there was something I was  
overlooking. Doesn’t seem to be.

Keith B.  
Tel: +49-7731-79838380  
removed\_email\_address@domain.invalid  
[http://keithbingman.com](http://keithbingman.com)

---

<div class="post-metadata">

**Author:** ![islepilot](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/ac8455/32.png) [@islepilot](https://www.ruby-forum.com/u/islepilot)\
**Post date:** [May 29, 2007, 4:49pm UTC](https://www.ruby-forum.com/t/iframe-links/105365/4 "2007-05-29T16:49:33Z")

</div>

Keith B. wrote:

> Yes. That is clear. I am trying to link directly to a page with an  
> iFrame from an external link. Basically a bookmark. I think I know  
> how to do it, but thought I see if there was something I was  
> overlooking. Doesn’t seem to be.

I understand. I would probably use Javascript to make this work. For  
example a URL [http://host/frameset.html?content.html](http://host/frameset.html?content.html) would load the  
frameset and a Javascript within this page can evaluate the query string  
and load the appropriate page into the frame. This script may or may not  
work:

Oliver

---

<div class="post-metadata">

**Author:** ![islepilot](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/ac8455/32.png) [@islepilot](https://www.ruby-forum.com/u/islepilot)\
**Post date:** [May 29, 2007, 4:59pm UTC](https://www.ruby-forum.com/t/iframe-links/105365/5 "2007-05-29T16:59:45Z")

</div>

Basically, it sounds to me as if you are trying to load a page which  
contains an iFrame, and then programmatically direct that iFrame to  
load a different source than its default. If I were doing it in PHP  
(sorry) I would script the iFrame to load a sanitized version of a  
querystring variable. Maybe someone on the list will be able to tell  
you how to do this in R/R/R.

Walter

---

<div class="post-metadata">

**Author:** ![islepilot](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/ac8455/32.png) [@islepilot](https://www.ruby-forum.com/u/islepilot)\
**Post date:** [May 29, 2007, 5:05pm UTC](https://www.ruby-forum.com/t/iframe-links/105365/6 "2007-05-29T17:05:46Z")

</div>

Yes, this is exactly what I am trying to do.

My basic plan at the moment is to make a Virtual Page type for the  
mian pae (with the iFrame) and grab the query string. Then I can just  
reset the source of the iFrame or redirect the page. Hopefully, that  
will work.

You guys have helped a lot, I will let you know what I actually end  
up doing.

Keith B.  
Tel: +49-7731-79838380  
removed\_email\_address@domain.invalid  
[http://keithbingman.com](http://keithbingman.com)

---

<div class="post-metadata">

**Author:** ![islepilot](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/ac8455/32.png) [@islepilot](https://www.ruby-forum.com/u/islepilot)\
**Post date:** [May 29, 2007, 4:54pm UTC](https://www.ruby-forum.com/t/iframe-links/105365/7 "2007-05-29T16:54:45Z")

</div>

This is what I was thinking of doing, though perhaps as a Virtual  
page. My Ruby is better than my javascript… But I will give it a  
thought. Thanks!

Keith B.  
Tel: +49-7731-79838380  
removed\_email\_address@domain.invalid  
[http://keithbingman.com](http://keithbingman.com)
