link menu item to single 'new' page with multiple iframes

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
mchapin
Beginner
Beginner
Posts: 8
Joined: Tue Feb 20, 2007 9:07 pm

link menu item to single 'new' page with multiple iframes

Post by mchapin »

I am trying to load a new page from the menu and the new page has 2 iframes

when i load the new page i want to load specific pages into the iframes within it

I am urgently trying to launch this site, so any imidiate help would be amazing
i've looked through the forum without any luch on this specific situation

i saw this url - http://support.milonic.com/demos/load_m ... /index.htm - but it loads the main page into a frame - i just have a basic page to load and need to specify the content of the iframes within
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hi,

This is a kind of long post but it does set up using the menu to open a new page with an iframe and load the iframe. There is reference to loading more than one, and how to code the aI for that, but Kevin didn't say how the function would have to be done to have more than 1 iframe load. Maybe you can figure it out from the post.

viewtopic. ... 8626#38626

Hope this helps. If you do figure out how to change the function to do the multiple iframe load could you post back?

Ruth
mchapin
Beginner
Beginner
Posts: 8
Joined: Tue Feb 20, 2007 9:07 pm

Post by mchapin »

thanks i'll give it a shot
mchapin
Beginner
Beginner
Posts: 8
Joined: Tue Feb 20, 2007 9:07 pm

Post by mchapin »

I looked through that htread - but the only part that directly aplies is the scripting at the end - but it is set up so that the entire content of the site would have to run through a 'container' page frame - this isn't really an option for me

I was really hoping for some jund of script to add, and an example of the line of code to add to the menu

to call a new url and load specified pages into this new pages iframes.
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hi,

I'm not sure I understand. The only thing that would run through the container page would be the link you wanted to open in a new window with the iframes on it, if you knew how to load multiple iframes from that code which only loads one.

So, for example, you'd create the container.htm page, and then in the one item that you want to open into that iframe on that container page you'd code the aI string for that.

So, a menu with 3 items in it, and one you want to open in an iframe on that new page, the items would be code like this:

Code: Select all

aI("text=Partners;target=container;url=container.htm?partners.htm;"); 
aI("text=Home;url=http://www.mysite.com/;");
aI("showmenu=Help;text=Help Docs;");
aI("text=License;url=http://www.mysite.com/license.htm;");
Assuming this is your site, the first aI would open the page called container which has an iframe and it would load the page called partners into the iframe. The second aI is a link to your home page and if clicked would just go to your home page, it would not open that in the container since you didn't code the aI url parameter to open the container or load the container. So, you would not be loading your site into the container unless in every

Code: Select all

aI string you had target=container, and url=container.htm?whateverpage. 
This is the only way I know to have an item in the menu:

1. open a new page which has an iframe on it, and
2. load the iframe on that new page with a specified page.

So, am I misunderstanding what you want to do? Do you have your site up so I can see the menu and the one item you want to do this so I can show you how?

Ruth
mchapin
Beginner
Beginner
Posts: 8
Joined: Tue Feb 20, 2007 9:07 pm

Post by mchapin »

now we're getting somewhere - very helpfull so far

the only difference is not opening a new window just loading a totally new page, like normal - but with the iframes in the new page that need pages specifically loaded into it

so to clarify i think we're on track

but not new 'window' - new 'page'

lookin forward to the next reply - excited as i think we're gonna solve this

thx alot
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hi,

Well, I can get what you want, but only with one iframe. As I said, I don't know js so I don't know how to change the function so it loads two iframes.

So, let's say the page you want to go to in the link is called linkpage.htm, and on that page you have an iframe and when you click the menu to go to linkpage.htm you want the iframe to load test.htm

This is how you'd do that:

1. create the linkpage.htm with the iframe and name the iframe, let's call it iframe1.

2. on that page put the js function code

Code: Select all

<script   type="text/javascript"> 
function loadIframe() 
{ 
  var urlStr; 
  urlStr = location.search.slice(1); 
  window.frames.iframe1.location = urlStr; 
} 
</script> 
In the aI string code it as

Code: Select all

aI("text=Open linkpage.htm;url=linkpage.htm?test.htm;"); 
That will just open/load right where you are the linkpage.htm with the test.htm page in the iframe.

Now, from here I can't do any more. I do not know how to change that function so it refers to loading two iframes.

If you know how to change the function for that, then I believe the aI string would be

Code: Select all

aI("text=Open test1 and test2 .htm;url=linkpage.htm?iframe1=test.htm&iframe2=test1.htm;"); 
Ruth
mchapin
Beginner
Beginner
Posts: 8
Joined: Tue Feb 20, 2007 9:07 pm

Post by mchapin »

havent tried this yet, but i think you nailed it from the looks of it - thanks alot
mchapin
Beginner
Beginner
Posts: 8
Joined: Tue Feb 20, 2007 9:07 pm

Post by mchapin »

sorry, i tried to do it just like that, made new pages called that just to test - and can't seem to get it working

made new linktest page and new test page named iframe1 on link test page, pasted script into linktest page "header"
pasted in menu link code

still nuthin - iframe1 shows page no disp - at end of url... (empty reference)

gonna try the script in the body now on the linktest page with the iframe1 on it
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

oops :oops:

I bet you didn't notice and I sure forgot to post here, though I put it in the other page where I did it with the open a new window

YOu put the script in the head, but the body tag needs an onload statement

Code: Select all

<html> 
<head> 
<script   type="text/javascript"> 
function loadIframe() 
{ 
  var urlStr; 
  urlStr = location.search.slice(1); 
  window.frames.iframe1.iframe2.location = urlStr; 
} 
</script> 
</head> 
<body onload = "loadIframe()"> 
Sorry. It will never load without that...

Ruth
mchapin
Beginner
Beginner
Posts: 8
Joined: Tue Feb 20, 2007 9:07 pm

Post by mchapin »

YES!!!

Ruth, you are a godsend - thankyou so much
mchapin
Beginner
Beginner
Posts: 8
Joined: Tue Feb 20, 2007 9:07 pm

Post by mchapin »

i can not stress enough how much of a help you have been

thx again
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

you're very welcome.

Did you figure out how to do it with more than one iframe? I sure would like that if you did.

Ruth
oavs
Beginner
Beginner
Posts: 1
Joined: Thu Jun 26, 2008 4:03 am

Re: Text link menu item to single 'new' page with SINGLE iframes

Post by oavs »

Excellent. I have a slightly different requirement. Principle of the whole thing described above is basically the same.

I know this post is going way back and hoping I could catch

1. I will only have one iFrame
2. Instead of drop down menus, I will have text links.

So I have a vertical column where my menu items are. Say you select the first 'Microsoft' text link with a URL= http://www.microsoft.com/windows/ie/ie6 ... setup.mspx, then iframe will display the contents of the MS page within the iframe.

On the other hand if you select the second menu option say 'Google' with a URL=http://www.google.com' then same iFrame would only display contents of the link from that menu.

My problem is how to wrap different links to the menu items to show within the iframe.


Menu
Microsoft Link >> iframe1 (with Microsoft link content)

Google Link >> iframe1 (with Google link content)

Many Thanks
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Re: link menu item to single 'new' page with multiple iframes

Post by Ruth »

Hi,

This is for the Milonic menu, if you are trying to just click a text link and do this you would need to do a search on the internet for something like js function to load iframe in new window from link. I'm sure there are any number of sites which would have info on that.

Ruth
Post Reply