Low End Mac
Search LEM 
Donate · Amazon.com · MacResQ · Advertise
Other Cobweb sites: Low End Living · Reformed.net

Quicklinks: · Power Macs · 'Books · Early Macs · Week's Best Deals · Best Buys · OS Downloads

Low End Mac's Online Tech Journal

Web Design, Part 1

Using Include Files

Low End Mac Reader Specials

Memory To Go Special: MacPro 8 Core Memory 4GB kit $192 / 2GB kit $109. MacBook Pro / MacMini / iMac Intel Core2 DUO 2GB $44 1GB $23--Free shipping available.

Download Typestyler, still the Ultimate Styling Tool for Internet, Print and Video Graphics. Works great in Classic with a Native OS X Version on the way. Free Tryout: www.typestyler.com

LA Computer Company: LA Computer Company: Specials on AppleCare, Apple Displays, MacBooks, iMac's, MacBook Pros, Laptop and iPod accessories and more. Apple A/C Adapters for laptops starting at $25.00 Call 1-800-941-7654 or Click Here.

Other World Computing: Go Longer Between Charges with a NewerTech NuPower Batteries! Not just another battery, NuPower available for PowerBook and iBook models, is built in the USA to offer the longest Run Time + the longest useful LifeTime too! In Stock at OWC from $99.95

Mac users can finally play Party Poker for Mac. Not only that, they can also learn how to play PokerStars for Mac.

Laptop Hardware Provided by TechRestore - Overnight Mac & iPod Repairs.

Compare products like desktop computers, laptops, and LCD TVs side by side! All the information and reviews to make the best purchasing decision for a new cell phone GPS products or MP3 players. The Ciao network makes searching products easy for you.

MacPro Memory 667Mhz With Apple Spec Heat Sink 2GB Kit $ 90 / 4GB Kit $140 / 8GB Kit $278 Click to Maximize your Macs...

Dan Knight - 2000.02.24

When I started designing web pages, I knew nothing about HTML. I used Claris Home Page and put things together until they looked right.

Three years later, I know very little HTML. I still use Claris Home Page. And I still design visually, trying to make things look right.

But there have been a lot of changes, large and small, during those three years. Not only did The New Low End Mac User shorten its name and broaden its focus (from just pre-Quadra desktops), but I've learned a lot of tricks that make managing the site a lot easier than it used to be.

The biggest change is invisible to the visitor. Every page on this site uses a technique called Server Side Include (SSI) to combine several files into a single page of code.

Why Use Server Side Include?

A lot of information is repeated from page to page in a site like Low End Mac. Each page has navigation links across the top and a copyright notice on the bottom. Most pages have a navigation bar on the right. Some pages include links to recent articles of interest. And recently I've begun creating "printer friendly"* versions of new articles.

* Printer friendly means different things to different people. In my case, it means the page should not run off the right side of your printer paper, the text should be black for clarity (and to save color ink if you're using a color printer), and links should be underlined (they aren't otherwise underlined using browsers that support Cascading Style Sheets, but that's a future article). On Low End Mac, the printer friendly page eliminates the navigation bar on the right and lets the text flow to whatever width your window or printed page is.

Once upon a time, the navigation links and copyright notice were hard coded into every page on the site. That meant a quick run through with BBEdit every time January rolled around to change the copyright notice. It also meant I had to open each and every page to make changes. That got to be very time consuming as the site grew.

Then I learned about SSI on the Mac Webmasters email list. Once I understood it, I quickly implemented it on my site. It's made my page files smaller and greatly reduced the number of files I have to update when changing the site.

How Server Side Include Works

A basic web page contains all the HTML used to display things properly. A page using SSI is incomplete, using external files to complete itself. For instance, every page on Low End Mac includes the following code:


<!--#include virtual="top.txt" -->

This instruction tells the server to insert the text in the file "top.txt" where the #include instruction appears. In this case, it pulls in a file that looks like this (I've shortened it significantly):


<P><A HREF="index.shtml">Low End Mac</A> &#149;
<A HREF="/news/index.shtml">Mac News Today</A> &#149;
<A HREF="/ibook/index.shtml">iBook Page</A> &#149;
<A HREF="/imac/index.shtml">iMac Channel</A> &#149;
<A HREF="/macinschool/view.shtml">View From the Classroom</A> &#149;
<A HREF="/rumormill/index.shtml">The Rumor Mill</A></P>

That text appears at the top of the page like this (sample links may not work):

Low End MacMac News TodayiBook PageiMac ChannelView From the ClassroomThe Rumor Mill

By having anywhere from one to several dozen pages use the same file, each individual page file is smaller. Better yet, to add a new section, I only need to update the "top.txt" file, not all the files in that directory.

The same procedure is used with the copyright notice at the bottom of the page, the right-side navigation bar, and links to recent articles.

Most recently, I've begun using SSI to create printer friendly versions of editorial content. Instead of having two pages that duplicate the same text (and two files to update when I find a typo, grammatical error, or just want to update things), both pages use the same include file, which contains the body of the article.

That's how this page is constructed - and the beautiful thing is, because it's the server that puts all the pieces together, all you see is a single seamless page.

Although it did take quite a bit of time to update the hundreds of pages on Low End Mac to use SSI, in the long run it has saved a lot of time as I've updated the copyright notice, changed the navigation, and updated the "recent articles" links. LEM


Part 2: Site Organization

Recent Online Tech Journal Columns

Recent Content on Low End Mac

  • Leopard is the way to go, even on most old G4 Macs, Carl Nygren, My Turn, 05.14. The useful and just cool features in Mac OS X 10.5 make this the biggest step forward in the history of the Mac OS.
  • Mac OS 9 still nice, anticipating Odysseus, PowerBook 1400 upgrades, and more, Charles W. Moore, Miscellaneous Ramblings, 05.14. Also rebuilding PowerBook batteries, FastMac vs. NuPower replacement batteries, and only one G4 upgrade left for WallStreet PowerBooks.
  • Windows on Macs: Three paths for integration, Jason Packer, Macs in the Enterprise, 05.14. Mac users have three routes for running Windows apps: Run Windows using Boot Camp or virtualization, or use a compatibility layer such as WINE.
  • Up-to-date or low-end, we need technology in our schools, John Hatchett, Recycled Computing, 05.14. Modern computers are great educational tools, but sometimes less distracting options (like no Internet) make more sense.
  • Best iMac G4 deals, Low End Mac Deals, 05.14. Used 15" 800 MHz Combo, $320; SuperDrive, $380; 1 GHz Combo, $400; SD, $485; 17" 1.25 GHz, $459; 20", $750.
  • Best Mac OS X 10.0-10.3 deals, Low End Mac Deals, 05.14. Mac OS X 10.0.3, $40; 10.1, $49; 10.2, $60; 10.3 DVD, $50; CD, $100; 10.1 Server, unlimited users, $109; 10.3 Server, $130.
  • Best MacBook Air deals, Low End Mac Deals, 05.14. 1.6 GHz, 80 GB, $1,694 after rebate; 1.8 GHz, $1,994 a/r; 1.6 GHz, 64 GB SSD, $2,689 a/r; 1.8 GHz, $2,950 a/r; SuperDrive, $99.
  • Mac of the Day: Quadra 700, Oct. 1991 - The successor to the Mac IIci ran a 'wicked fast' 25 MHz 68040 processor.
  • List of the Day: NewtonList supports Newton users.
  • May 15 in LEM history: 00: Advantages of a small Mac market - 01: Just different - Restoring after reformatting your hard drive - Mac as religion in the UK - The CRT isn't dead yet - 02: Xserve G4 - Why laptops need docks - 03: Don't break up Apple, build it up - Upgrades for slot-loading iMacs - 06: Old Macs still fun to use, productive tools - Is Mac OS 9 still a player? - David G. Wood's Mac legacy - 07: 13" 2.16 GHz MacBook - 8 free apps every Mac user should know
  • 10 cult Macs adored by collectors, Tamara Keel, Digital Fossils, 05.13. Macs are not only noted for their longevity, but also by the passion which collectors have for some of the most interesting models ever made.
  • Low End Mac's Compleat Guide to the Lombard PowerBook G3, Charles W. Moore, 'Book Value, 05.13. With the Lombard PowerBook, Apple abandoned the legacy ADB and serial ports for USB, trimmed 20% from WallStreet's weight, and hit 400 MHz.
  • Best PowerBook G3 deals, Low End Mac Deals, 05.13. Used 14" WallStreet G3/266 MHz, $90; Lombard G3/400 MHz, $200; Pismo G3/400 MHz, $300; 500 MHz, $350.
  • Best Apple TV deals, Low End Mac Deals, 05.13. Refurb 40 GB Apple TV, $199; new, $210; refurb 160 GB, $279; new, $319.
  • Best Xserve deals, Low End Mac Deals, 05.13. Used 1 GHz dual G4, $1,399; close-out 2.0 dual-core Xeon, $1,999; refurb 2.66, $2,799; 3.0, $3,499; new 2.8 GHz quad, $2,888; 8-core, $3,299; 3.0, $4,059.
  • More links in our archive.

Go to the Online Tech Journal index.


Have a question?
Ask an expert!

Low End Living

Amazon.com

Navigation

Used Mac Dealers
Apple History
Best Used Macs
Video Cards
Email Lists
InfoMac's Low
End Mac Forum

Favorite Sites

MacSurfer
MacMinute
MacInTouch
MyAppleMenu
InfoMac
Macs Only!
The Mac Observer
Accelerate Your Mac
RetroMacCast
PB Central
MacWindows
The Vintage Mac
   Museum

DealMac
DealsOnTheWeb
Mac2Sell
ramseeker
Mac Driver Museum
JAG's House
System 6 Heaven
System 7 Today
the pickle's Low-End
   Mac FAQ

Abandonware
   Petition

Mac vs. PC Info

Affiliates

The Apple Store
Mac Connection
MacMall
TechRestore
MacResQ
ExperCom
Crucial Memory
batteries.com

Advertise

Open Link