It's a bad practice for a page to link to itself, unless its an anchor. It is a small difference, but it's all about the details, isn't it?
Preferably, both markup and visual appearance should be different. For demosite, it means:
instead of
instead of
(although I don't think the site needs a third link home anyway)
instead of
In xslt, it's as simple as a check for "@sc_currentitem/@id = @id" or "@sc_currentitem/@id = sc:GetLinkItem(...)/@id".
Below is the difference between xslt of vertical menu (the most complex of 3 changes). Before:
<a href="{sc:path(.)}" class="text_2">
<!-- link content we don't want to duplicate -->
</a>
After:
<xsl:variable name="tagname">
<xsl:choose>
<xsl:when test="@id = $sc_currentitem/@id">span</xsl:when>
<xsl:otherwise>a</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:element name="{$tagname}">
<xsl:attribute name="href"><xsl:value-of select="sc:path(.)" /></xsl:attribute>
<xsl:attribute name="class">text_2</xsl:attribute>
<!-- link content we don't want to duplicate -->
</xsl:element>
Wouldn't it be nice if <sc:link /> could handle it by itself? It is a breaking change, unfortunately.