Here's a little more to get you going, which also makes sure not to call NiceUrl() if no node was picked (throws nasty Int32 error if not):
<xsl:template match="/">
<!-- some output -->
<!-- output link here, if there was a node picked: -->
<xsl:apply-templates select="$currentPage/PICKER_ALIAS[normalize-space()]" />
<!-- some more output -->
</xsl:template>
<!-- Template for link -->
<xsl:template match="PICKER_ALIAS_HERE">
<a href="{umbraco.library:NiceUrl(.)}">Link text</a>
</xsl:template>
Use Content Picker in XSLT for links
Small question, I could not find the answer.. What is the syntax for using the content picker for a link in the new scheme:
I got my contentpicker content and now i want to use it in my XSLT like this: <a href="link taken from umbraco" />
How is it done? Do i use <xsl:attribute ?
Thanks
Brian
Hi Brian,
You just send the contents to NiceUrl() - e.g., like this:
/Chriztian
Found the answer allready. Hope someone else can use it.
Like this:
<a href="{umbraco.library:NiceUrl($node/contentPickerName)}">
Ah sorry Chriztian but thinks anyway :-)
This should work for you
Basically the content picker returns an id, so NiceUrl returns the path
Rich
Here's a little more to get you going, which also makes sure not to call NiceUrl() if no node was picked (throws nasty Int32 error if not):
/Chriztian
is working on a reply...