Skip to content

Instantly share code, notes, and snippets.

@terrywbrady
Last active August 29, 2015 14:03
Show Gist options
  • Save terrywbrady/2bd83490464f434ebcb4 to your computer and use it in GitHub Desktop.
Save terrywbrady/2bd83490464f434ebcb4 to your computer and use it in GitHub Desktop.
Override XMLUI Home Breadcrumb Link
<xsl:template match="dri:trail">
<li>
<xsl:attribute name="class">
<xsl:text>ds-trail-link </xsl:text>
<xsl:if test="position()=1">
<xsl:text>first-link </xsl:text>
</xsl:if>
<xsl:if test="position()=last()">
<xsl:text>last-link</xsl:text>
</xsl:if>
</xsl:attribute>
<!-- Determine whether we are dealing with a link or plain text trail link -->
<xsl:choose>
<!-- Insert the <xsl:when> to change the URL for "HOME" in the breadcrumb -->
<xsl:when test="./@target = concat($context-path,'/')">
<a>
<xsl:attribute name="href">
<xsl:text>http://www.library.georgetown.edu/digitalgeorgetown</xsl:text>
</xsl:attribute>
<xsl:apply-templates />
</a>
</xsl:when>
<xsl:when test="./@target">
<a>
<xsl:attribute name="href">
<xsl:value-of select="./@target"/>
</xsl:attribute>
<xsl:apply-templates />
</a>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates />
</xsl:otherwise>
</xsl:choose>
</li>
</xsl:template>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment