Ohh yeah you are right Rob! A typo, I fixed it in the above code now.
And for the las() part, yes it can be very handy in a lot of situations. Always nice when we don't have to count our items, even though I'm sure your solution would work as well :)
help in breadcrumb
Hello,
I am trying to make breadcrumb like this
Home >> Solutions >> By Industry
I am getting breadcrumb some thing like this ....
Home Solutions By Industry
This is my code
How to get ">>" in between ?
Hi vaibhav
Try changing the for-each to something like this:
<xsl:for-each select="$currentPage/ancestor-or-self::* [@level > $minLevel and string(umbracoNaviHide) != '1']">
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:value-of select="@nodeName"/>
</a><![CDATA[ >> ]]>
</xsl:for-each>
/Kim A
Thanx for reply Kim A.
If i use
<![CDATA[ >> ]]>
then i get my breadcrumb as
Home >> Solutions >> By Industry >>
but i want breadcrumb as
Home >> Solutions >> By Industry
<xsl:variable name="nodes" select="$currentPage/ancestor-or-self::* [@level > $minLevel and string(umbracoNaviHide) != '1']"/>
<xsl:variable name="count" select="count($nodes)"/> <xsl:for-each select="$nodes">
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:value-of select="@nodeName"/>
</a> <xsl:if test="position() < $count"><![CDATA[ >> ]]></xsl:if>
</xsl:for-each>
Try that.
Ahh yeah, of course. Try this instead:
/Kim A
I didn't know about last(), handy!
Minor bug: you just need brackets on your position, but that's a very short and neat solution.
Ohh yeah you are right Rob! A typo, I fixed it in the above code now.
And for the las() part, yes it can be very handy in a lot of situations. Always nice when we don't have to count our items, even though I'm sure your solution would work as well :)
/Kim A
It certainly cleans up the code, I've got loads of nav stuff that generates a CSS class to flag the last item that could be enshortened with this!
Hi vaibhav
Did you solve your problem with one of the small tweaks Rob and I provided?
/Kim A
yup thanx....
is working on a reply...