Next / Previous / Contents / NM Tech homepage

7.3.4. The bot.links template

This template outputs the standard page-bottom navigational links. These links start with a boldfaced term such as “Next” that match the links on the top of the page, followed by a link to the target page using that page's title as the link text. Each link line is wrapped in its own div element, and the entire set of links is wrapped in another div with class="botlinks" to allow CSS markup.

zdp_html.xsl
<!--bot.links:  Bottom-of-page links-->
<xsl:template name="bot.links">
  <xsl:param name="prev"/>
  <xsl:param name="next"/>
  <xsl:param name="home"/>
  <div class="botlinks">

First comes the “Next” link.

zdp_html.xsl
    <!--"Next" link-->
    <xsl:if test="count($next) &gt; 0">
      <div class="bot-next">
        <b>Next: </b>
        <a>
          <xsl:attribute name="href">
            <xsl:call-template name="href.target">
              <xsl:with-param name="object" select="$next"/>
            </xsl:call-template>
          </xsl:attribute>
          <xsl:apply-templates select="$next" mode="object.title.markup"/>
        </a>       
      </div>
    </xsl:if>

Next comes the “Contents” link, similarly, wrapped in a div with class="bot-contents".

zdp_html.xsl
    <!--"Contents" link-->
    <xsl:if test="$home != .">
      <div class="bot-contents">
        <b>Contents: </b>
        <a>
          <xsl:attribute name="href">
            <xsl:call-template name="href.target">
              <xsl:with-param name="object" select="$home"/>
            </xsl:call-template>
          </xsl:attribute>
          <xsl:apply-templates select="$home" mode="object.title.markup"/>
        </a>       
      </div>
    </xsl:if>

The “Previous” link works just like the “Next” link.

zdp_html.xsl
    <!--"Previous" link-->
    <xsl:if test="count($prev) &gt; 0">
      <div class="bot-prev">
        <b>Previous: </b>
        <a>
          <xsl:attribute name="href">
            <xsl:call-template name="href.target">
              <xsl:with-param name="object" select="$prev"/>
            </xsl:call-template>
          </xsl:attribute>
          <xsl:apply-templates select="$prev" mode="object.title.markup"/>
        </a>       
      </div>
    </xsl:if>

The "Help" link is optional; it is added only if the help.url parameter is defined.

zdp_html.xsl
    <!--"Help" link (optional)-->
    <xsl:if test="$help.url" >
      <div><b>Help: </b>
        <a href="{help.url}">
          <xsl:value-of select="help.long.name" />
        </a>
      </div>
    </xsl:if >

    <!--"Home" link-->
    <div>
      <b>Home: </b> 
      <a href="{$home.url}" >
        <xsl:value-of select="$home.long.name" />
      </a>
    </div>
  </div>
</xsl:template>