I want to use frames but know I shouldn't!

This is a discussion on "I want to use frames but know I shouldn't!" within the Website Planning section. This forum, and the thread "I want to use frames but know I shouldn't! are both part of the Planning Your Website category.



Go Back   Webforumz.com > Main Forums > Planning Your Website > Website Planning

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Oct 11th, 2007, 12:49
Up'n'Coming Member
Join Date: Sep 2007
Location: Canterbury
Age: 31
Posts: 53
Thanks: 0
Thanked 0 Times in 0 Posts
I want to use frames but know I shouldn't!

The reason I want to use frames (DON'T SHOUT AT ME i'M POSTING THIS TO AVOID THEM - I now know why they are sinful! ) is because you can have a single navigation item used on every page of your site so if you add a page you only need to update one file to put a link on every page. My friends tell me this can't be done with CSS but I read elswhere that it can. So my question is: how? Please treat me like an idiot as I know virtually nothing about CSS and am technologically cursed.
Reply With Quote

  #2 (permalink)  
Old Oct 11th, 2007, 12:53
SuperMember

SuperMember
Join Date: May 2007
Location: UK
Age: 27
Posts: 1,111
Thanks: 0
Thanked 0 Times in 0 Posts
Re: I want to use frames but know I shouldn't!

Use php includes instead. Unfortunately this requires setting up a web server on your own computer.

CSS cannot do this.
Reply With Quote
  #3 (permalink)  
Old Oct 11th, 2007, 12:56
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: I want to use frames but know I shouldn't!

By using includes ... you can use PHP or SSI

If your server supports PHP, here's how you do it.

Put your navigation in another file and call it nav.inc. The extension doesn't matter here. It could be .php, .html, .checkit, etc....

So in this nav.inc you have

HTML: Select all
<div id="navigation">
    <ul>
        <li><a href="/">Home</a></li>
        <li><a href="/services/">Services</a></li>
        <li><a href="/portfolio/">Portfolio</a></li>
        <li><a href="/contact/">Contact</a></li>
    </ul>
</div>
Now, you main page you must rename to .php so ... index.html becomes index.php, and you just need to add the php include() statement to add your navigation

PHP: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
   "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en-US">

<head>
    <title>Some title</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    
</head>

<body>

<div id="branding">Company X</div>

<?php include('nav.inv'?>

<div id="content">bla bla bla</div>

<div id="siteinfo">copyright bla bla</div>

</body>
</html>
Reply With Quote
  #4 (permalink)  
Old Oct 11th, 2007, 12:57
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: I want to use frames but know I shouldn't!

Quote:
Originally Posted by MikeHopley View Post
Unfortunately this requires setting up a web server on your own computer.

CSS cannot do this.

Only to test on your computer. You don't *need* to set up your computer as a server ... just upload it to your hosting server.
Reply With Quote
  #5 (permalink)  
Old Oct 11th, 2007, 13:16
SuperMember

SuperMember
Join Date: May 2007
Location: UK
Age: 27
Posts: 1,111
Thanks: 0
Thanked 0 Times in 0 Posts
Re: I want to use frames but know I shouldn't!

Quote:
Originally Posted by karinne View Post
Only to test on your computer. You don't *need* to set up your computer as a server ... just upload it to your hosting server.
That's true; I'm assuming that most designers want to test a lot, rather than continuously upload.
Reply With Quote
  #6 (permalink)  
Old Oct 11th, 2007, 13:20
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: I want to use frames but know I shouldn't!

Unless you work directly off the server
Reply With Quote
  #7 (permalink)  
Old Oct 11th, 2007, 15:41
moojoo's Avatar
Moderator
Join Date: Aug 2005
Location: Texas
Age: 31
Posts: 1,761
Blog Entries: 1
Thanks: 0
Thanked 18 Times in 18 Posts
Send a message via AIM to moojoo Send a message via MSN to moojoo Send a message via Yahoo to moojoo
Re: I want to use frames but know I shouldn't!

there are ways to do this without PHP as well. As I think someone said SSi would work as well although I personally prefer PHP.

Code: Select all
<!--#include file="foo.html" -->
__________________
The internet is just a fad.
http://www.mevans76.com
Last Blog Entry: Apps every Mac based web dev should consider (Jul 10th, 2008)
Reply With Quote
  #8 (permalink)  
Old Oct 11th, 2007, 18:40
Up'n'Coming Member
Join Date: Sep 2007
Location: Canterbury
Age: 31
Posts: 53
Thanks: 0
Thanked 0 Times in 0 Posts
Re: I want to use frames but know I shouldn't!

Ok, thanks guys - i'll have to look into that some other time as there are more urgent things to do. I can't beleive you replied so quickly!
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Frames Help lithiumforce Starting Out 4 Jun 25th, 2007 10:39
Frames piratescotty Web Page Design 8 May 22nd, 2007 19:11
Nav Bar/Frames - Plz help!!! design4586 Graphics and 3D 2 Jun 14th, 2006 16:26
Frames Pointblank Web Page Design 7 Jan 27th, 2006 21:30
I need help with frames!!!! courtjester Web Page Design 2 Sep 20th, 2003 07:30


All times are GMT. The time now is 02:53.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43