|
Simple SSI DirectivesBefore we start doing anything too daring, here's the general form of an SSI directive:
When your webserver comes across one of these tags it replaces it with whatever is specified by the element and attribute values. This could be any number of things, such as the current date, the date the file was last modified or the contents of another file. I created my navigation bar by setting it out in a file on its own and then including it on every page. The source for this is:
...and its placed within a table which is set up on each page. In hindsight, it would have made sense to put the table set-up tags in the include file, but it makes little odds for a site this size. Notice that the file I'm including is also server-parsed (its extension is shtml). This is because I wanted to use SSI directives in the navbar itself. The server parses each file as it loads it, all in one go, so I needed to tell it to parse the included file before it pastes it into the document. The 'last update' is also done by an SSI, like this:
Line 1 sets the format I want the date displayed in. %e/%m/%Y means display the date in the form "DD/MM/YYYY". Line 2 just prints the built-in variable 'LAST_MODIFIED' using the format I specified. A full list of the SSI elements and attributes is here. |