Web Hosting Talk







View Full Version : Help Needed - does anyone know how to do this?


chilliboy
11-16-2000, 10:33 AM
Can anyone explain how I can do this:-

I wish to create a link from a non frames page that will automatically load into the bottom frame of a new page.

This would save me no end of time as I would hopefully not have to create a seperate frameset page, for each time I want to create a link in this way.

Anyone got an easy solution? I'm using Dreamweaver, if that helps or if anyone knows an extension, that would make it simple.

Chicken
11-16-2000, 11:05 AM
Is this so you can have external links to other sites (and keep a small area at the top so they can easily get back to your site)? I'm assuming this isn't an attempt to hide the actual URL of another site.

Without having the frameset already in place, you have to create one. I'm really not sure what you are trying to do. Target and errrr... (base is it???) tags are the only ways to get something to load in a frame. Maybe some js, but I don't personally use js for critical things. Loading links is critical I believe.

(What I mean by critical, is that I don't use js for navigation, etc, only small effects that don't really matter, or that enhance functionality of something, without being required).

chilliboy
11-16-2000, 11:45 AM
Yep your right Chicken.

I want to get a small border at the top of the site I link to so that I can put a back button into it.

So in effect what I want to do is;

A: from a none frames page have a hypelink to http://www.whatever... This link then opens up a new page with two frames (3 including the frameset). The small top frame has my back button in it and the bottom frame loads the URL of the link from the previous page.

It would be simple to get round the problem (as most sites do) by having the first page in frames and then the link opening up in one of the frames. However I don't want to uses frames on most of the pages on my site.

I understand that you need to have a frameset already in place to link to eg link to ... frameset.html ... top is the 'back to my site' and bottom loads the link page.

I would have thought it would be relatively easy; I've seen a few site accomplish the effect by having a url link along the lines of http://www.originalsite.com?linksite.com.
- But I don't know how it works?

I thought a non JS solution would be along the lines of how you can open a frames page from a non frames pages and automatically go to a anchor tag 'link'.

Chicken
11-16-2000, 08:35 PM
This is just one thing that screams pointless to me:

If you are opening up a new window, then why would you need a framed 'back to...' page? There wouldn't be anything to go back to (since this is a new browser session), and if they did click 'bak' they'd have two occasions of your site open at the same time. Did you think of this?

Usually, popping up a new browser window kinda eliminates the need for this. I think it would be better to stay in the same frame (as the actual site), but open in the frameset you are thinking of creating.

chilliboy
11-17-2000, 05:44 AM
Sorry Chicken - Maybe I'm getting you totally confused.

Maybe the best way to explain an example of EXACTLY what I want to achieve is give you a working example.

Have a look at this link: http://www.breathe.com/sport/football/ under the headlines section it lists 'Gaurdian News Feeds' which are available via isyndicate or from the guardian site itself. Try clicking on one of the news feed links - this the the effect I want to achieve. Notice the strange URL when you roll over the link.

inwks
11-17-2000, 08:59 AM
Easy:

Taking your example:

http://www.mysite.com/frame.asp?site=http://www.sitetoshow.com

in asp, frame.asp would be:

<%
mstrFrameURL = Request.QueryString("site")
If mstrFrameURL = "" Then mstrFrameURL="http://www.mysite.com/showerror.html
%>
<html>
<head>
<title>My Site show sitetoshow</title>
</head>
<frameset rows="95,*" frameborder="NO" border="0" framespacing="0">
<frame SRC="/myheader.html" scrolling="NO" noresize frameborder="NO" marginwidth="0" marginheight="0" name="topnav">
<frame SRC="<% =mstrFrameURL %>" NAME="body" marginwidth="0" marginheight="0" noresize frameborder="NO">
</frameset>
</html>

Basically your frame creation page would have a small script to read the querystring and automatically insert it into the frame tags for the browser to interpret. Don't be fooled by breathe's .html tag on this, as they probably have set HTML to go through some parser first.

chilliboy
11-20-2000, 06:55 AM
Cheers,

I posted the same question on Sitepoint. Creole gave me the following answer which may be of interest:

Hmmmm...I don't know how they get that effect, but I have been seeing it a lot lately. I would try checking some of the PHP (are you using PHP?) sites for help on that. http://www.devshed.com and http://www.hotscripts.com have tons of pre-made scripts and resources for that sort of thing.

Also, even though the links are are generated and not hard-coded, you can still have them open in a frameset like I suggested. When you print out the links, just make them link to a page that is the frameset.

DUH!!!

Do it this way. Make the frameset page normally, then make the bottom page, that the frameset calls, a variable (your content) such as $myurl. Then, when you print out the links on your main page, you have them print out the variable name.

<frameset>
frame one=navigation menu
frame two=$myurl
</frameset>

Then, when you print out any link on the front page, you just pass the variable to the frameset page and BOOM, any link you click on opens in the exact same frameset.

I don't know the exact mechanics of it, but that should be exactly what you should need...as a matter of fact, I might try that myself for a site that I am working on.

Thanks for the help Chilliboy...hehehe

Thread is : http://www.sitepointforums.com/showthread.php?threadid=11727

Chicken
11-20-2000, 09:36 AM
Originally posted by chilliboy
Maybe the best way to explain an example of EXACTLY what I want to achieve is give you a working example.

That never hurts, heh. So are we all settled then? Can I go back to bed? Do I have to go to work? Bahhh...

inwks
11-20-2000, 09:39 AM
humbug