...

View Full Version : Special Code required? Frameset Linking



Imperial_T
07-26-2007, 02:05 AM
I have a website that uses frames. For Search engine optimization reasons I have a number of pages that are not in frames.

My question is this:

How can I link from the regular (no frame) pages back to the main frameset while loading custom pages to the midframe frame source?


<html>
<head>
<title>Photography</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<frameset rows="9*,101,367,40,71*" cols="*" framespacing="0" frameborder="NO" border="0">
<frame src="toptop.html" name="topFrame1" scrolling="NO" noresize >
<frame src="top.html" name="topFrame2" scrolling="NO" noresize >
<frame src="main_page.html" name="midFrame">
<frame src="bottom.html" name="bottomFrame1" scrolling="NO" noresize>
<frame src="bottombottom.html" name="bottomFrame2" scrolling="NO" noresize >
</frameset>
<noframes><body>
</body></noframes>
</html>


So basically I'd like to externally link to this frameset page but instead of it loading the "main_page.html" in the frame source called "midFrame" I would like it load a different page in there say "portrait_page.html"

Is this possible and does it require some special type of script or coding?? I can't seem to figure it out.

Imperial_T
07-27-2007, 02:33 AM
Javascript Maybe?

_Aerospace_Eng_
07-27-2007, 02:38 AM
Yes javascript. You would need to check to see if the page is in a frame or not. If its not in a frame then redirect to your frameset. To load the page the user was viewing you would need to set a cookie, to get the page url and then read it on the frames page checking to see if the cookie exists unfortunately I haven't been able to find a script online that does this. I ran across one once but can't find it anymore. I'm also not about to write a custom script for you either. Here are some links that might help though
http://quirksmode.org/js/cookies.html
http://www.javascriptkit.com/script/script2/keepframes.shtml

Imperial_T
07-28-2007, 04:25 AM
Well, I'm going back to pages that viewers have nessesarly viewed already., so I'm not sure the Cookies woudl be the way to go.

I have multiple links going from a page that certainly is not in frames and linking to a frameset, The only thing is I want to be able to load the frameset and the ability to load seperate pages inside one of the frames.

_Aerospace_Eng_
07-28-2007, 04:28 AM
Yes cookies would be the way to go because you would need to make a cookie that tells the browser what page the user visited outside of the frameset. Then on the frameset page you check for the cookie, if its there then you redirect them to the cookie value. I've told you what you have to do, now its up to you to figure out how. I gave you the resources you needed as well. Good luck. No one is going to write this script for you from scratch.

Imperial_T
07-28-2007, 07:00 AM
Uhh,, I don't recall asking you or anyone to write me a custom code so please don't make it seem like I'm begging you to work for free.

In cases like these usually someone has ran into this problem before and just pastes up some code they've used and I would arrange it to fit my page

I thank you for your "resourses", One link didn't work and the other (although generally useful) addresses a different issue from the one I stated.

whizard
07-28-2007, 07:15 AM
Ok everyone, lets remain calm, Aero wasn't being rude.

IMHO, the best way to receive help around here is not to come in with 4 posts and let the forums #1 member have it with both barrels!

:D

Dan

_Aerospace_Eng_
07-28-2007, 07:19 AM
Uhh,, I don't recall asking you or anyone to write me a custom code so please don't make it seem like I'm begging you to work for free.

In cases like these usually someone has ran into this problem before and just pastes up some code they've used and I would arrange it to fit my page

I thank you for your "resourses", One link didn't work and the other (although generally useful) addresses a different issue from the one I stated.

http://www.quirksmode.org/js/cookies.html is the correct url. The second link will redirect any page opened out of the frameset to the index page. I told you would need to customize it by creating and reading cookies.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum