Hello

Does anyone know how to disable the current link in a breadcrumb trail.

All that i know in XSLT has failed

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">&#187;</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>

If your current page has the IsOpenPage attribute set to 1, then this XSLT should work just fine.

Thanks pritaeas, but how do i diable the current link in the trail though.

Home> link 1 > current link >

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.