Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:41
link menu item to single 'new' page with multiple iframes
Poster: mchapin
Dated: Tuesday February 20 2007 - 20:12:13 GMT
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
Poster: Ruth
Dated: Tuesday February 20 2007 - 21:00:59 GMT
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.
http://www.milonic.com/forum/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
Poster: mchapin
Dated: Tuesday February 20 2007 - 21:30:03 GMT
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.
Poster: Ruth
Dated: Tuesday February 20 2007 - 23:18:43 GMT
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:
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;");
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:
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
Poster: mchapin
Dated: Tuesday February 20 2007 - 23:46:39 GMT
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
Poster: Ruth
Dated: Wednesday February 21 2007 - 0:47:58 GMT
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:
<script type="text/javascript">
function loadIframe()
{
var urlStr;
urlStr = location.search.slice(1);
window.frames.iframe1.location = urlStr;
}
</script>
function loadIframe()
{
var urlStr;
urlStr = location.search.slice(1);
window.frames.iframe1.location = urlStr;
}
</script>
In the aI string code it as
Code:
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:
aI("text=Open test1 and test2 .htm;url=linkpage.htm?iframe1=test.htm&iframe2=test1.htm;");
Ruth
Poster: mchapin
Dated: Wednesday February 21 2007 - 3:30:15 GMT
havent tried this yet, but i think you nailed it from the looks of it - thanks alot
Poster: mchapin
Dated: Wednesday February 21 2007 - 4:04:58 GMT
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
Poster: Ruth
Dated: Wednesday February 21 2007 - 5:13:18 GMT
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:
<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()">
<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
Poster: mchapin
Dated: Wednesday February 21 2007 - 5:20:57 GMT
YES!!!
Ruth, you are a godsend - thankyou so much
Poster: mchapin
Dated: Wednesday February 21 2007 - 5:33:38 GMT
i can not stress enough how much of a help you have been
thx again
Poster: Ruth
Dated: Wednesday February 21 2007 - 6:36:46 GMT
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
Re: Text link menu item to single 'new' page with SINGLE iframes
Poster: oavs
Dated: Thursday June 26 2008 - 4:12:36 BST
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
Re: link menu item to single 'new' page with multiple iframes
Poster: Ruth
Dated: Thursday June 26 2008 - 6:16:24 BST
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