4 users online. Create an account or sign in to join them.Users
Breadcrumb
This is an open discussion with 9 replies, filed under Extensions.
Search
Hey, I just sent a pull request for this extension in order to make it compatible with Language Redirect and Multilingual Field...
@nitriques
If you need the parent hierarchy, PLH supplies a datasource just for this purpose :)
@vladG:
Yes I know, tried it, but without any luck. Traversing the tree upwards was not what I wanted. It take to much skill to do that in XSL and my co-workers would not be able to do it.
I really needed a "flat" list representing the page "tree" structure. Since the breadcrumb extension was already doing that, I figured it just needed a little bit of refactor.
@vladG: But I used your DS in order to build a link that translate the page :)
I have obviously missed something (in xpath) as this isn;t working for me. I am using the following XSL code:
<ul id="breadcrumbs">
<xsl:for-each select="/data/breadcrumb/page">
<li><a href="{$root}/{page/@path}"><xsl:value-of select="page" /></a></li>
</xsl:for-each>
</ul>
To process this XML:
<breadcrumb>
<page path="attending">Attending</page>
<page path="attending/agenda">Agenda</page>
</breadcrumb>
The name and path values are not populating in the HTML output. Can anyone suggest why?
Thanks :-)
@stuartgpalmer
This should fix your problem... try replacing page by dot (.). Dot will refer to the current element
<ul id="breadcrumbs">
<xsl:for-each select="/data/breadcrumb/page">
<li><a href="{$root}/{./@path}"><xsl:value-of select="." /></a></li>
</xsl:for-each>
</ul>
Thanks @Nitriques. That did the job and taught me a new Xpath trick :-)
@stuartgpalmer: You're welcome... You can use this with apply-templates too.
You can check http://www.w3schools.com/xsl/ for a quick formation in XSL. I use this site a lot for reference in diverse w3 fields (html, css, javascript, xsl(t))
./@path could simply be written as @path.
Create an account or sign in to comment.
A new Extension, “Breadcrumb” is now available for download. Comments and feedback can be left here but if you discover any issues, please post it on the issue tracker.