This XSLT displays "breadcrumbs" based on simple dir.xml files that you stick in your site directories (put one in each directory up the tree that you want to appear in the breadcrumbs, with the format <dir id="root"><title>Home</title><path>/</path></dir>, the root dir.xml has to have id root, the others should not).

Have I finally found a use for axkit: URIs that can't be replicated any other way? (because they know your current path)

simon

PS See it in action on http://semacode.org

<xsl:template name="InsertPathbar">
<xsl:param name="curpath" select="'.'"/>
<xsl:variable name="nocurdirxml" select="boolean(document(concat('axkit:',concat($curpath,'/dir.xml')))/ error)"/>
<xsl:variable name="notroot" select="document(concat('axkit:',concat($curpath,'/dir.xml')))/dir/@id != 'root'"/>
<xsl:if test="$nocurdirxml or $notroot">
<xsl:call-template name="InsertPathbar">
<xsl:with-param name="curpath" select="concat('../',$curpath)"/>
</xsl:call-template>
<xsl:if test="not($nocurdirxml)">
<xsl:text> &gt; </xsl:text>
</xsl:if>
</xsl:if>
<xsl:variable name="curdirpath"
select="document(concat('axkit:',concat($curpath,'/dir.xml')))/dir/ path"/>
<xsl:variable name="curdirtitle"
select="document(concat('axkit:',concat($curpath,'/dir.xml')))/dir/ title"/>
<span id="pathbaritem">
<a href="{$curdirpath}">
<xsl:value-of select="$curdirtitle"/>
</a>
</span>
</xsl:template>



-- http://simonwoodside.com


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to