Tuesday, August 23, 2005

Don't Repeat, Include instead!

Many designers don't realize, or have ever heard of an include file. I find myself teaching this stuff to all newbies all the time. So here it goes, short and sweet, if you need to repeat any part of your design onto more than one page, then use an include file.

So what is this include file, you ask? Simple, it is the html code you would normally use on your Web page, cut and pasted onto a stand alone file, saved as nameoffile.inc

Couldn't be any simpler. What does this include file do for you? Well among many things, it saves you time when you need to update this part of the file. Include files are great for navegation units or footers. These are things that tend to appear on every page on your Web site, and is usually a tidious process if you need to update even a simple link.

So how do you use it? you simple make a reference to it in your HTML code like this:

<!--#include file="http://www.yoursite.com/yourincludepath/yourfile.inc" -- >

or if your server allows for virtual urls then:
<!--#include virtual="/yourincludefolderpath/yourfile.inc" -- >

couldn't be any easier, try it, it will save you a lot of time and Web coding when creating/designing your page.

P.S.> One last tip, keep track of your tables, I recommend you don't break up your tables inside an include. In other words, start and end your tables inside the code of your include, or the inc files could potentially become a nightmare to track.
Digg This Del.icio.us Slashdot

0 Comments:

Post a Comment

Links to this post:

Create a Link

<< Home