Forum Moderators: phranque

Message Too Old, No Replies

Cross Linking between Framesets

Cross Link Framesets

         

djsnuff

4:30 pm on Jan 19, 2004 (gmt 0)

10+ Year Member



I know this must be simple to do but I can't find anything in the help file!

I need to know how to make the target of a link, a specific frame of a different frameset, containing the relevant content page?

eg. If "Sport"link is clicked from homepage, the "Sport" page opens in a new frameset with the "Sport" displayed in the main frame.

Any help would be much appreciated!

jimbeetle

4:43 pm on Jan 19, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Welcome to Webmaster World, djsnuff.

If I read your question right there really isn't a "simple" way to do this, that is, anything built into html as it stands today.

There are a couple of javascript solutions that "build" a frameset on the fly. Do a search for "dynamic frameset" to find them. Try out a couple of different ones to find which best suits your needs.

I used to use the one from Netscape DevEdge. Very powerful and flexible and easy enough to tweak the js to use just what you need.

Hint: Depending on how your site is set up the parameter call in the dynamic url might make it appear to SEs and site search functions (if applicable) that there are many extra pages in the site (thispage.htm vs. frameset.com?main=thispage.htm). I found that disallowing the cgi-bin in robots.txt took care of this.

Another Hint: You might also consider using a framebuster script in conjunction with the dynamic frameset to ensure that pages are always displayed in their proper frames.

thehittmann

5:14 pm on Jan 19, 2004 (gmt 0)

10+ Year Member



If this is a standard basic frameset this is all you need to do. Lets say the links are in a frame caled leftFrame and you want this to show in the main section called mainFrame. The frame names are specified in the frameset.htm if they aren't then they need to have names.

<a href="sport.htm" target="mainFrame">sport</a>
this will open the page called sport in the mainFrame and leave the left frame as it stands.

djsnuff

9:52 am on Jan 20, 2004 (gmt 0)

10+ Year Member



Thanks for the prompt response guys, however I think I may not have explained myself very well, as these solutions don't work!

I have a homepage composed of frameset's, in the framesets are links to other parts of the site. To minimise the site I want to use only 3 framesets. One with left hand margin, one with right hand margin and one with both. The homepage always has both margins. So if I click a link for "sport" from the homepage, I want the sport page to appear in the main frame of the frameset with no left margin, how do i do this?

Apologies at the clumbsy use of english but i don't know the correct terminology!

thehittmann

10:16 am on Jan 20, 2004 (gmt 0)

10+ Year Member



the only way that i can think of is having 2 framests that both use the same rightframe but otherwise are different. then what would be happening is switching framesets. not just changing pages. This would mean though having a different frameset for each link aswell. lots of messing around. I dont know of another way to do it.

djsnuff

11:03 am on Jan 20, 2004 (gmt 0)

10+ Year Member



oh well, yes thats what I've been doing to date, using a seperate frameset for each seperate area of the site.
Thanks anyway!

jimbeetle

2:58 pm on Jan 20, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



djsnuff, take a closer look at the dynamic framesets I mentioned above. These will work for you, in fact, they are designed to do exactly what you want to accomplish.

Example, set up three dynamic framesets with the different formats you need:

frame-both-margins.htm
frame-noleft-margin.htm
frame-noright-margin.htm

Your sport.htm link is on the homepage, you want it to open in the frameset with no left margin.

The link would read, depending on the sets frame names:

frame-noleft-margin.htm?main=sport.htm

And, depending on how you right your initial frameset you can make all of the frames within it dynamic.

Assume your frame-noleft-margin.htm includes a "header" frame, right-hand "menu" frame and a "main" content frame. You can use a link that will right the frameset on the fly that will put whatever pages you want into each of these frames. Example:

frame-noleft-margin.htm?header=sport-header.htm&menu=sport-menu.htm&main=sport.htm

It can be a bit daunting fiddling with the javascript, especially with the Netscape DevEdge version, but if you take your time so you know what each line of the code is doing you can tweak it to get exaclty what you want.