The 'Include' File Command

The ***include file*** command is a useful command that more people need to know about.

Basically put, it copies the contents of a file to where you place the ***include file*** tag.

A good example to discuss this would be the menu you see on the right-hand side of this tutorial page ------------------>>

As you can see, the menu is repeated for every page in this tutorials section. If I hard-coded it in directly, I'd have a hell of a time changing it on every page it occurs on. So instead I used the ***include file*** command to get AutoKeen to re-copy the code from one source every time it updates.

For this example, I created a file called ensignlist.html. In this file I keep the code for the list of links that forms the menu. In the workspace version of this page, I then inserted ***include ensign/ensignlist.html*** .

Now for the breakdown of the tag. ***include is the command, while ensign/ensignlist.html is the file name, and the second row of stars *** closes the command. The ensign/ before ensignlist.html tells AutoKeen that ensignlist.html in the folder called 'ensign'. This is because I have ensignlist.html in the folder ensign. For normal pages jsut put filename.txt or whatever.

Every time I update (granted, it's not that often, but let's not get into that) I only need to make changes to ensignlist.html. The next time I update, AutoKeen will automatically update the side menu for me based on the contents of ensignlist.html.

Simple eh? One thing to keep in mind that AutoKeen copies this from /public_html and not /workspace, and when you might have to update the page twice for the first include to show up: Once for the source code to appear in public_html, another time for AutoKeen to copy the contents of that file to where the tag is.

And that's it!



This tutorial by Ping Teo of The Jaded.

Keenspace Gear hosted by
Keenspace, a free webcomics hosting service of
Keenspot.

Keenspace Gear v2.0 site design by
Ping Teo @ Phalanx (2004).
I am not paid to do this, so any appreciation and encouragement would be welcome ;)