...

View Full Version : deep linking to framed pages



KevinG
12-05-2002, 12:27 AM
i have site which has one 'products' section which uses frames - the rest of the site does not use frames - here's my problem:

is it possible to link to different pages in my frameset directly, as currently i seem to be able to only link to one default page within my frameset and then i have to browse to the original page i wanted within my frameset.

e.g i have five links on my home page (a page that does not use frames) and 3 of those links need to link to 3 seperate pages in the framed section of my site - how do i do this? when i link directly it only shows the page - not the the other two frames (index on the left or the top part of my site).

heres my home page - http://www.designermortgages.com/index.htm

from the home page i would like to link to 2 or 3 pages in this framed section of my site - http://www.designermortgages.com/mortgages/mortgages.htm

ronaldb66
12-05-2002, 09:35 AM
KevinG,

i don't have a direct answer to your question, but i know a similar question has been asked before and one of the forum members offered some clever javascript to solve this problem. It concerned linking to a frame from outside the site and the scripts took care of placing the linked document in the right frameset again.
It probably was in the "HTML & CSS" forum, or maybe in one of the javascript forums, possibly in the old forums.
I'm afraid you'll just have to do some searching on topics like linking to framesets, breaking a frameset, or something like that.
Perhaps someone else has a better memory?

The only other solution i can come up with is using dedicated framesets for each page. This causes an increase in documents to be created, and seems mute, but the real advantages of using frames still hold up. Also, it doesn't depend on javascript. It's your call...

KevinG
01-08-2003, 12:58 PM
still no luck with this problem.

can anyone suggest a solution?

Kiwi
01-08-2003, 03:24 PM
I did something like this ages ago. Basically, you embed a reference to the frames into the query string. You can then access this from javascript and load the pages to each frame as appropriate.

I don't have time to dig up the acutal code right now, but it's not too hard to do.

jalarie
01-08-2003, 03:51 PM
Add a query string to your link to indicate which page you're trying to get into the frames:

&nbsp;<a href="fctl.htm?target.htm">Link</a>

In the frame-control (fctl.htm) page, pick up the link:

&nbsp;<script...>
&nbsp;&nbsp;T=document.location.search.substring(1);
&nbsp;</script>

Make sure that you include a default just in case the link is missing:

&nbsp;if (T=='') {T=default.htm;}

Use the link thus obtained to write the frame control information:

&nbsp;document.write('<frameset...');
&nbsp;document.write('<frame src="'+T+'">');
&nbsp;...

See it in action at my web site. Go to the link below, click on the title of any page in the lower-right frame, notice that you've popped out of frames, navigate a bit using the upper arrows or lower buttons, then click on the "Return to Frames" link at the bottom of the page. You'll return to frames with that page in the lower-right frame.

&nbsp;http://spruce.flint.umich.edu/~jalarie/

brothercake
01-08-2003, 03:52 PM
MSDN does something like that as well - you'll see their fully-qualified urls are basically

http://.../somescript.asp?full-url


When you load "full-url" page on its own, it has a script in it which reloads the page's parent frameset, parsing to it a reference to the pages which should be inside it. You could document.write the frameset, as jalarie suggested, or just dynamically change the frame srcs



But my instinct - and my best advice to you - is don't use a frameset. What benefit does using frames bring you - there is probably a better way of acheving the same benefit.

KevinG
01-09-2003, 06:14 PM
i decided to do it the safest way - i made each page into its own frameset - took me ages and was a bit complicated but at least it works.

cheers guy



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum