Next / Previous / Contents / NM Tech homepage

7.3.5. The zdp.colophon template

The colophon section contains:

  1. A horizontal rule to separate it from the page-bottom links.

  2. An HTML address element containing lines for each author, and a mailto: link for reader feedback.

  3. A “Last updated” timestamp.

  4. The document's URL.

The template takes one parameter, home, the article node. It needs that to generate the “Contents” link.

zdp_html.xsl
<!--zdp.colophon: Colophon at the bottom of the page-->
<xsl:template name="zdp.colophon">
  <xsl:param name="home"/>

First comes the horizontal rule, then the start of a div element with class="colophon" so we can write CSS rules for this section, then the start of the address element.

zdp_html.xsl
  <hr/>
  <div class="colophon">
    <address>

To generate all the author names, we call a separate template; see Section 7.3.6, “The author.colophon.mode template”.

zdp_html.xsl
      <!--Generate all author names-->
      <xsl:apply-templates select="$home/articleinfo/authorgroup"
        mode="author.colophon.mode"/>

The mailto: link forwards mail to tcc-doc@nmt.edu, which is the mailing alias for the TCC Documentation Group. This ends the HTML address element.

zdp_html.xsl
      <!--mailto: link for reader feedback-->
      <div class="colophon-mailto">
        <xsl:text>Comments welcome: </xsl:text>
        <a href="mailto:${email.to.author}">
          <xsl:value-of select="$email.to.author" />
        </a>
      </div>
    </address>

The “Last updated” line is wrapped in a div to put it on a separate line. The datetime.format template is located in common/pi.xsl. It uses the EXSLT extension module http://exslt.org/dates-and-times; see the online documentation for dates-and-times.

zdp_html.xsl
    <!--Revision timestamp-->
    <div class="colophon-date">
      <xsl:text>Last updated: </xsl:text>
      <xsl:call-template name="datetime.format">
        <xsl:with-param name="date" select="date:date-time()"/>
        <xsl:with-param name="format" select="'Y-m-d H:M'"/>
      </xsl:call-template>
    </div>

We use Server Side Includes to generate the page's own URL; see Using HTML Server Side Includes (SSI). SSI commands are syntactically represented as comments whose first character is "#". The echo command causes insertion of some variable's value into the web page, and the DOCUMENT_URI variable is always the URL of the web page itself.

zdp_html.xsl
    <!--Show current URL using Server Side Includes-->
    <div class="colophon-url">
      <xsl:text>URL: </xsl:text>
      <span class="colophon-uri">
        <xsl:text>http://</xsl:text>
        <xsl:comment>#echo var="HTTP_HOST"</xsl:comment>
        <xsl:comment>#echo var="DOCUMENT_URI"</xsl:comment>
      </span>
    </div>
  </div>
</xsl:template>