and (umbraco.library:Request('tag') = '' or contains(data [@alias = 'tags'],umbraco.library:Request('tag')))]">
<li>
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:value-of select="@nodeName"/>
</a>
</li>
</xsl:for-each>
</ul>
I am struggling to convert this to the latest xsl schema, this is what I have tried:
<ul> <xsl:for-each select="$currentPage/* [@isDoc and string(umbracoNaviHide) != '1' and (umbraco.library:Request('tag') = '' or contains(@tags,umbraco.library:Request('tag')))]"> <li> <a href="{umbraco.library:NiceUrl(@id)}"> <xsl:value-of select="@nodeName"/> </a> </li> </xsl:for-each> </ul>
The xslt will save without any errors but if I set a tag in the filter the page returns blank.
Can someone help me with the correct code for this example. Thanks for links to other pages that feature the latest xslt code but I am still struggling in some places to convert from the old schema..
Thanks Chriztian will give that a try. Yeh I had a nagging feeling that I should be using a variable but was perhaps following the tutorial code too closely, takes a while for the penny to drop when I start learning new languages!
Thank you Chriztian that code worked perfectly! And thanks Jeroen for the link that looks as though it could be very useful for me working with some of the older code samples from the video tutorials
Help with converting old schema tags Xslt
I am trying to convert the neat example for filtering by tag selection as featured in one of Tim's datatype video tutorials, here is his code:
<ul>
<xsl:for-each select="$currentPage/node [string(data [@alias='umbracoNaviHide']) != '1'
and (umbraco.library:Request('tag') = '' or contains(data [@alias = 'tags'],umbraco.library:Request('tag')))]">
<li>
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:value-of select="@nodeName"/>
</a>
</li>
</xsl:for-each>
</ul>
I am struggling to convert this to the latest xsl schema, this is what I have tried:
<ul>
<xsl:for-each select="$currentPage/* [@isDoc and string(umbracoNaviHide) != '1'
and (umbraco.library:Request('tag') = '' or contains(@tags,umbraco.library:Request('tag')))]">
<li>
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:value-of select="@nodeName"/>
</a>
</li>
</xsl:for-each>
</ul>
The xslt will save without any errors but if I set a tag in the filter the page returns blank.
Can someone help me with the correct code for this example. Thanks for links to other pages that feature the latest xslt code but I am still struggling in some places to convert from the old schema..
Hi Bob,
This should take care of the filtering - even the case of no tag in QueryString (not tested, though):
Always, always, always create a temp variable for stuff that makes your XPath impossible to read (and error-prone to change).
/Chriztian
Thanks Chriztian will give that a try. Yeh I had a nagging feeling that I should be using a variable but was perhaps following the tutorial code too closely, takes a while for the penny to drop when I start learning new languages!
You can try the XsltUpdater package. Perhaps your code is already fine after that.
Jeroen
Thank you Chriztian that code worked perfectly! And thanks Jeroen for the link that looks as though it could be very useful for me working with some of the older code samples from the video tutorials
There is also the online converter tool made by Tommy Poulsen here: http://blackpoint.dk/umbraco-workbench/tools/convert-xml-schema-to-45-.aspx?p=2
/Jan
is working on a reply...