Does anyone know how to disable the current link in a breadcrumb trail.
I am working on a bspoke CMS and i have been asked to remove the current link in the breadcrumb trail.
All that i know in XSLT has failed and i have quite some time on, XSLT is no my strength and i need some helpful input.
Please help
here is the XSLT code:
[code]
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html" omit-xml-declaration="yes" />
<!--
Variable to determine if the current open page is displayed as a link or plain text
select = 1 - displays plain text link
select = 0 - displays link (default value)
-->
<xsl:variable name="DisableCurrentPageLink" select="0" />
<xsl:template match="BreadCrumbTrail">
<xsl:apply-templates select="Page" />
</xsl:template>
<xsl:template match="Page">
<span class="BCTDelimiter">»</span>
<xsl:choose>
<xsl:when test="$DisableCurrentPageLink = 1">
<xsl:choose>
<xsl:when test="@IsOpenPage = 1">
<span class="breadcrumb-link">
<xsl:value-of select="@Title"/>
</span>
</xsl:when>
<xsl:otherwise>
<a href="{@URL}" class="breadcrumb-link" title="{@Title}">
<xsl:value-of select="@Title" />
</a>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<a href="{@URL}" class="breadcrumb-link" title="{@Title}">
<xsl:value-of select="@Title" />
</a>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
[/code]
It’s hard without seeing the input form. That code will make an unlinked span for pages that have
<page IsOpenPage="1">as the markup, but does you CMS add that attribute for the relevant pages?If the currently open page is always last in the trail you could change
to