Links and IFRAME

mc se7en

New Member
Messages
218
Reaction score
4
Points
0
I'd still like an answer to this, but due to some limitation I've found with IFRAMEs, I've decided not to do this.

----

I'm having a little problem using IFRAMEs in my site. Specifically, I want to use an IFRAME for my header (and footer, but I'll do that later). The header includes a navbar. When I click a link on this navbar, it opens in the IFRAME instead of the actual page.

Here's the deal: Every time I want to change my navbar or header (or footer), I have to change it manually on every page (a painful process). I'm trying to avoid that irritation by using an easy-to-edit IFRAME to update all pages at once. So far only the navbar is in the IFRAME but I'm going to get the logo in there hopefully in a few minutes. EDIT: logo is now in the IFRAME too.

The current page in question is [link and page removed.]

Any help on getting these links to open in the main window would be much appreciated.

Thanks!
 
Last edited:

xgreenberetx

New Member
Messages
57
Reaction score
1
Points
0
I would make a separate page custom size it for a header only, and use the server side include function.

<!--#include virtual="header.html" -->

You will just have to add the links on every linked page.
 

mc se7en

New Member
Messages
218
Reaction score
4
Points
0
Is there an easier way to do it? Since I'm using iWeb, that would actually be more complicated because I'd have to publish, download the page, edit the page, re-FTP it to the server and then repeat for every updated page, because iWeb replaces the entire html file when it publishes rather than just the changes to the file.
Edit:
ah you know, ive found some stuff that isnt going to work this way. thanks for the answer but ive changed my mind about the iframe. however, youve earned some rep. :D
 
Last edited:

Twinkie

Banned
Messages
1,389
Reaction score
12
Points
0
You have include {target="_parent"} in the links so the browser knows you are reffering to the parent window.
Code:
<a href="page.html>Text</a>

to

<a href="page.html" target="_parent">Text</a>
I would recommend a server side include, it is less hassle.
 
Last edited:

mc se7en

New Member
Messages
218
Reaction score
4
Points
0
You have include {target="_parent"} in the links so the browser knows you are reffering to the parent window.

Code:
<a href="page.html>Text</a>

to

<a href="page.html" target="_parent">Text</a>

I would recommend a server side include, it is less hassle.

Ha, I knew there had to be a target for it, but Google turned up nothing. Thanks very much! It's actually less of a hassle to do that then to have to use the other method with iWeb! Thanks again! You've also been rep'd!
 

Twinkie

Banned
Messages
1,389
Reaction score
12
Points
0
I found the answer by entering: 'make links in iframe open in main window' in google :p

Thanks for the rep :)
 
Last edited:

mc se7en

New Member
Messages
218
Reaction score
4
Points
0
I found the answer by entering: 'make links in iframe open in main window' in google.

I tried almost the same search with the phrase "parent frame" so im not sure why it didnt turn up. thanks for the help anyway!

edit: whoops…its doing the same thing when i try that…weird…ah well, this is just one more reason im not using the iframe after all lol
 
Last edited:

matthew88

New Member
Messages
9
Reaction score
1
Points
0
Well ur on this site.

Simply make a HTML file. name it navigationbar.html
Then to include the nav-bar in all other pages use the code

<?php include 'http://www.example.com/navigationbar.html';?>

idk if that could be made any easier.
You can also inline javascript the IFRAME/URL path you want the link/frame to go to.


----------------------------------------

<A href="javascript:change3()">
<script>
function change3()
{
parent.B_._pic.location="http://whatever.com/_W_/members_profiles/member01/pic3.htm";
}</script>

----------------------------------------

parent = parent frame, each . (dot on down is each sub-frame down.)
B_ = was the body frame.
_pic = was the picture frame.
location = URL which the frame gets and loads.

Hope some of this stuff helped.
 
Top