jelly46 Posted March 14, 2012 Share Posted March 14, 2012 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: <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> Link to comment Share on other sites More sharing options...
boen_robot Posted March 14, 2012 Share Posted March 14, 2012 Everything with this code seems fine at first sight... could you give a sample XML that would be given to this XSLT? Maybe it's an XPath issue (i.e. you're not targeting the nodes you think you're targeting). Link to comment Share on other sites More sharing options...
jelly46 Posted March 16, 2012 Author Share Posted March 16, 2012 Yeah it does, but I've made an error i need the link hidden or removed. Link to comment Share on other sites More sharing options...
boen_robot Posted March 17, 2012 Share Posted March 17, 2012 Again - some sample XML please... to help you, I'll need to debug this extensively. Even if indeed that's not the issue, the XML is part of the puzzle non the less. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.