Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

target frameset from non-frame page 4

Status
Not open for further replies.

katiekat

Technical User
Jun 6, 2000
300
US
How oh how do I create a link from a non-frames page to a frameset and target two specific documents?

I have an index that is all flash. The second tier is going to be a simple frameset with a static menu on top and seperate documents loaded to the bottom frame. I want to be able to target specific bottom documents with the index page. So when they pick "contact" on the index, the frameset loads with the menu and contact page.

This seem so simple, yet I can't figure out what to do!!! Please help me!

Thank you thank you!!!! Holy tek-tips batman!:-0
 
create your frameset ie frameset.htm

in the frameset the file itself draws out the frame targeting te two files you want targeted

then just link to frameset.htm [Hammer]
Nike Failed Slogans -- "Just Don't Do It!"
 
I've always wanted to know how to do this too. I posted a question a long time about a starway responded. it's at thread216-339652

it's not perfect, but it's a start.
 
Ok First thing, In my opinion frames are not useful 95% of the time. But here is a step by step for what you want to do

First things first...What is a frameset?
It is just any regular old webpage which defines the layout and content of your frames...The following is a frameset with 3 frames....

<html>
<head>
<title>Test Me Out</title>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>
</head>

<frameset rows=&quot;*&quot; cols=&quot;150,*&quot; framespacing=&quot;0&quot; frameborder=&quot;NO&quot; border=&quot;0&quot; bordercolor=&quot;#CCCC99&quot;>
<frame src=&quot;leftframe.htm&quot; name=&quot;leftFrame&quot; scrolling=&quot;NO&quot; noresize>
<frameset rows=&quot;111,*&quot; cols=&quot;*&quot; framespacing=&quot;0&quot; frameborder=&quot;no&quot; border=&quot;0&quot; bordercolor=&quot;#CCCC99&quot;>
<frame src=&quot;topframe.htm&quot; name=&quot;topFrame&quot; scrolling=&quot;NO&quot; noresize >
<frame src=&quot;mainframe.htm&quot; name=&quot;mainFrame&quot;>
</frameset>
</frameset>
<noframes><body>

</body></noframes>
</html>

Lets call this file frameset.htm -- Notice Leftframe, mainframe, and topframe are the 3 frames.
Each frames has another page associated with it.

So frameset.htm is any old webpage except instead of it directly dispalying data it calls on 3 other pages to do that and it instead lays out the page for the user.

All you have to do is link to frameset.htm!

This will ensure that you link to the FRAME part... [Hammer]
Nike Failed Slogans -- &quot;Just Don't Do It!&quot;
 
I don't think that was the question? I could be wrong here, but my interpretation of the thread was that katiekat wanted to create several links on her intro flash page, eg Contact Us, About Us, etc etc etc but wanted to ensure that when she linked to the frameset, that the appropriate frame loaded, eg, if the user clicked on contact us, that the contact page loaded, rather than the default set in the frameset.

I could be wrong here, but that was my inpterpretation
 
Probably the simple way would be to create as many frameset pages as you need:

<html><head><title>Frameset 1</title></head>
<frameset rows=&quot;100,*&quot; frameborder=0 border=0>
<frame src=&quot;r1.htm&quot; name=&quot;TOP&quot; />
<frame src=&quot;r2.htm&quot; name=&quot;BOTTOM&quot; />
</frameset></html>

For each one replace r2.htm with the specific frame you wish to target. Clive
 
At you will find an extension called back to my frames. The extension ensures that the main frame cannot be opened as a single document. If the main frame document is requested the script will open the frameset. Hence a menu is available at all times.
[Hammer]
Nike Failed Slogans -- &quot;Just Don't Do It!&quot;
 
Ok.....it seems this is more difficult than I thought it would be! Making different framesets for each page kind of defeats the purpose...so maybe I'll rethink this. Hmn. Too bad.

Thanks for all your help guys!

kate Holy tek-tips batman!:-0
 
deecee

Good idea, I never thought of that. And I already had the code, but it never occurred to me to use it that way. I was just using it so that if a user requested a page outside of the frameset, for example from a search engine, that the frameset would load. Never thought of using it so that links within the site would do that too.

Katiekat

deecee's answer is just what you need, you don't have to create individual framesets
 
At you will find an extension called back to my frames. The extension ensures that the main frame cannot be opened as a single document. If the main frame document is requested the script will open the frameset. Hence a menu is available at all times.

Why do I find this familiar?

thread248-473200 am surprised not a word was changed HEHE
 
oh dear, I guess it's only fair that you get the star for the post then isn't it.
 
I didn't find that script, but I'm thinking that it would be fairly simple to pass a value containing info as to which page should be opened, right? Or is that what the other script does? Let me know if you have access to PHP so I can know whether to make this for you in PHP or JavaScript.

Rick -----------------------------------------------------------
RISTMO Designs
Arab Church
 
no the other scrip ensures that if you request a page (say main.html) that it will load in the frameset, basicly it replaces main.html with myframeset.html so that the nav bar etc (or whatever is in your frameset) loads rather than just the page requested. sorry, that probably sounds confusing.

I didn't check out the URL, but you can also get it at
 
If you can use PHP, you can place this as the link in the frame opening page:
<a href=&quot;frameset.html?ba=one&quot;>Page 1</a>
<a href=&quot;frameset.html?ba=two&quot;>Page 2</a>
<a href=&quot;frameset.html?ba=three&quot;>Page 3</a>
<a href=&quot;frameset.html?ba=four&quot;>Page 4</a>
<a href=&quot;frameset.html?ba=five&quot;>Page 5</a>
<a href=&quot;frameset.html?ba=six&quot;>Page 6</a>

Then in the frameset, add this where the frame should go:
<?
$pages=array();
$pages['one']=&quot;page1.html&quot;;
$pages['two']=&quot;page2.html&quot;;
$pages['three']=&quot;page3.html&quot;;
$pages['four']=&quot;page4.html&quot;;
$pages['five']=&quot;page5.html&quot;;
$pages['six']=&quot;page6.html&quot;;
?>
<frame src=&quot;<?= $pages[$ba] ?>&quot;>

Then just add the other settings to the frame, and it will work. An alternate solution that is simpler but requires you to use the url of the page instead of a &quot;nickname&quot; is this. In the frame opener page, add this:

<a href=&quot;frameset.html?ba=page1.html&quot;>Page 1</a>
<a href=&quot;frameset.html?ba=page2.html&quot;>Page 2</a>
<a href=&quot;frameset.html?ba=page3.html&quot;>Page 3</a>
<a href=&quot;frameset.html?ba=page4.html&quot;>Page 4</a>
<a href=&quot;frameset.html?ba=page5.html&quot;>Page 5</a>
<a href=&quot;frameset.html?ba=page6.html&quot;>Page 6</a>

Then in the frameset, add this where the frame should go:
<frame src=&quot;<?= $ba ?>&quot;>


As you can see, this is much easier. I wonder why I'm even posting the first part!

Rick
-----------------------------------------------------------
RISTMO Designs
Arab Church
 
ya mx its a great little link you got there, :))

look at it this way i gave you a star there and here since you do desever the credit for it [Hammer]
Nike Failed Slogans -- &quot;Just Don't Do It!&quot;
 
what's your url KatieKat?

try : 'url' ? 'contactpage.htm' & 'menupage.htm'

without spaces and without the apostrophes.
 
what's your url KatieKat?

try : 'url' ? 'contactpage.htm' & 'menupage.htm'


um ... what'll that do?

 
open a page in the proper frameset... but it'd be easier if i had the url and the path of where the pages are kept...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top