The L-Space Web: Developers

Headers Toolbars and Footers


With the adoption of XHTML, L-Space Web introducted the concept of local macro definition files. However there are some global macros which can be used "as is" or used to provide the building blocks for any customised, local, versions.

These building blocks can (and will typically) be used to create higher-level macros / templates for a specific section, into which more parameters and additional XHTML have been hardcoded.

For generic one-shot pages, or sections without special needs, the following higher-level macros can hopefully be used "as is".

They also serve as an example of how the building blocks can be used:

_X_DOCTYPE()

Result: expands to the proper <!doctype ...> line plus opening <html> tag for XHTML 1.0 Strict. This macro must be the first one called within any page wishing to use the XHTML macros.

Parameters: none.

Output:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">

_X_META($1, $2, $3, $4)

Result: expands to a set of L-Space appropriate <meta> tags. Should be called after _X_DOCTYPE_ and before anything else. This macro hardcodes the charset of the page to "iso-8859-1", and includes the MSSmartTagsPreventParsing meta tag.

Parameters:

$1 -- value for "keywords" meta tag: a space-separated list of case-sensitive keywords

$2 -- value for "description" meta tag: a normal, capitalised sentence, ending with a '.'

$3 -- value for "author" meta tag: a name (not an e-mail address)

$4 -- value signifying the character set to be used for this page

Output:

<meta http-equiv="Content-Type" content="text/html; charset=$4" />
<meta name="keywords" content="$1" />
<meta name="description" content="$2" />
<meta name="author" content="$3" />
<meta name="MSSmartTagsPreventParsing" content="TRUE" />

_X_CSS($1, $2)

Result: expands to a set of L-Space appropriate <link> tags. Should be called after (but not necessarily *immediately* after) _X_META. This macro hardcodes librarian@lspace.org as the value of the "made" link.

Parameters:

$1 -- value for the "title" attribute to the "stylesheet" <link>, i.e. a descriptive name for the stylesheet in question.

$2 -- value for the "href" attribute to the "stylesheet" <link>, i.e. the location of the stylesheet in question.

Output:

<link rel="stylesheet" title="$1" href="$2" type="text/css" />
<link rel="made" href="mailto:librarian@lspace.org" />

_X_HEADER($1, $2)

Result: creates a complete header for an XHTML page, down to the opening <body> tag. Generic L-Space keywords are hardcoded, as are "The L-Space Librarians" as the page authors and the name and location of the L-Space default CSS stylesheet.

Parameters:

$1 -- the title of the page. This string will appear in the browser window title bar.

$2 -- value for the page's "description" meta tag: a normal, capitalised sentence, ending with a '.'

Output:

_X_DOCTYPE
<head>
_X_META(Discworld Terry Pratchett L-Space lspace.org alt.fan.pratchett, $2, The L-Space Librarians, iso-8859-1)
<title>$1</title>
_X_CSS(Default Stylesheet, _CSS/default.css)
</head>

<body>

_X_TITLE($1, $2)

Result: creates an appropriate L-Space 'top bit' for the page. Typically, this macro should be called immediately after _X_HEADER.

Parameters:

$1 -- the 'navigation' string. This is what will appear in italics at the top left of the page. For now, this should probably just read "The L-Space Web".

$2 -- the 'title' string. This is what will appear centered in big blue characers at the top of the page.

Output:

<div class="smaller"><em>$1</em><hr /></div>
<div class="center">
<h1 class="blue">$2</h1>
<hr />
</div>

_X_TITLE_SUB($1, $2, $3)

Based on _X_TITLE with the addition of a subheading immediately below the main page heading. Again, this macro should be called immediately after _X_HEADER.

Parameters:

$1 = the 'navigation' string. This is what will appear in italics at the top left of the page. For now, this should probably just read "The L-Space Web".

$2 = the 'title' string. This is what will appear centered in big blue characers at the top of the page.

$3 = the subheading (bold, italicised). This will appear immediately below the main page heading and above the horizontal rule.

Output:

<div class="smaller"><em>$1</em><hr /></div>
<div class="center">
<h1 class="blue">$2</h1><p><strong><em>$3</em></strong></p>
<hr />
</div>

_X_SHORTTOOLBAR($1, $2, $3)

Result: creates a three-button L-Space toolbar for the bottom of the page.

Parameters:

$1 -- 'prev'. This is the URL that the go-left-button will lead to.
$2 -- 'up'. This is the URL that the go-up-button will lead to.
$3 -- 'next'. This is the URL that the go-right-button will lead to.

Output:

<div class="toolbar">
<hr />
<a href="$1"><img class="nav" src="/images/left-button.gif" alt="[Prev Page]" width="40" height="40" /></a>
<a href="$2"><img class="nav" src="/images/up-button.gif" alt="[Up]" width="40" height="40" /></a>
<a href="$3"><img class="nav" src="/images/right-button.gif" alt="[Next Page]" width="40" height="40" /></a>
<hr />
</div>

_X_SIMPLESTTOOLBAR($1)

Result: creates a one-button 'up-only' L-Space toolbar for the bottom of the page.

Parameters:

$1 -- the 'up' href. This is the URL that the up-button will lead to.

Output:

<div class="toolbar">
<hr />
<a href="$1"><img class="nav" src="/images/up-button.gif" alt="[Up]" width="40" height="40" /></a>
<hr />
</div>

_X_CREDITS($1)

Result: expands to an L-Space appropriate footer, consisting of "local" credits (section-specific) followed by "global" credits (site-specific), the latter hardcoded for L-Space in this macro.

Parameters:

$1 -- Section specific description/credit line.

Output:

<div class="local-credits">
<em>$1</em>
</div>
<p class="global-credits">
<em>_WEB_MAINTENANCE<br />
_MIRROR_MAINTENANCE</em>
</p>

_X_FOOTER()

Result: creates a complete footer for an XHTML pace, down to the closing </body> and </html> tags. This macro hardcodes the 'local' bit of the _X_CREDITS macro to refer to the L-Space Librarians.

Parameters: none.

Output:

_X_CREDITS(This section of L-Space is maintained by <a href="mailto:librarian@lspace.org">The L-Space Librarians</a>)
</body>
</html>


The following is a list of all the old headers and footers. Some have been upgraded to xhtml standards and some haven't, if in doubt check!

_SHEADER($1,$2)
_HEADER($1,$2)
_MTITLE($1,$2)
_SIMPLESTTOOLBAR(URL)
_SHORTTOOLBAR($1,$2,$3)
_SIMPLETOOLBAR($1,$2)
_LONGTOOLBAR($1,$2,$3,$4,$5)
_WEB_MAINTENANCE
_MIRROR_MAINTENANCE
_CREDITS
_FOOTER($1)
_HTMLFOOTER($1,$2)
_MFOOTER : for use in the Merchandise pages.
_AB_FOOTER : for use in the about-terry pages.
_AFPARTY_FOOTER : for use in the afparty pages.
_KIDBY_FOOTER : for use in the Kidby pages.
_FILK_FOOTER : for use in the filks pages
_TIMELINES_FOOTER : for use in the timelines pages
_AFPMEETS_FOOTER : for use in the afpmeets pages.
_FAQS_FOOTER : for use in the FAQ pages.

An explanation of some of these Old macros can be found here.


[Up]
This section of L-Space is maintained by The L-Space Librarians

The L-Space Web is a creation of The L-Space Librarians
This mirror site is maintained by The L-Space Librarians