6. Website customization

Table of Contents

6.1. Page presentation

Remember that Website is a tailored version of Docbook. Docbook styling can be customized in various ways. In addition, being Docbook, a good deal of basic customization is available using Docbook customization. This section explains the basics and provides references to web resources where more can be found out.

The Website site offers some examples of customization

Example 15 shows a basic customization layer that does two items of customization. The purpose is to import the main Website stylesheet, and little more. What it does show is the place where customization takes place

Example 15. A basic customization layer

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 xmlns:html='http://www.w3.org/1999/xhtml'
  xmlns:db="http://docbook.org/ns/docbook"
                version="1.0">
  <xsl:import href="/sgml/docbook/v5/website/xsl/chunk-website.xsl"/> 1
  <xsl:output method="html"/>

<!-- Insert a rule after the header on each page -->   2
<xsl:param name="header.hr" select="1"/>

<!-- Insert a rule before the footer on each page -->   3
<xsl:param name="footer.hr" select="1"/>

</xsl:stylesheet>

1

Import the main Website stylesheet

2

Add a rule after headers

3

And add one before footers


This example provides a minimal customization. For further information on more general Docbook customization see Bobs book which is far more complete.

For those into XSLT, take a look at the param.xsl file in the Website distribution.

6.1. Page presentation

One of the layout options available to you for presentation is to select from two ways in which the navigation information is presented to the user in the html pages. The choice is either unnamed (lets call it simple), and tabular, in which the navigation information is presented as a table column, on the left hand side of the page. The example above (Example 15) uses 'simple', by choosing the import target of website/xsl/chunk-website.xsl. To select the tabular layout, change this to website/xsl/chunk-tabular.xsl. Easy as that. The stylesheets take the same information (your files) and create a different layout. Try it and see if you like it.