Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi,
If
umbraco.library:NiceUrl(@id)
gets the url of the current page, how do I get the url that I have just picked in a content picker where the alias is 'testlink' for example?
I've tried along the lines of
umbraco.library:NiceUrl($currentpage/[@alias='testLink'])
but I just get an error when saving the xslt file.
Thanks,Rachel
Hi Rachel
$currentPage has a capital P, so this will probably be causing you issues. For posterity, here's what I use (a bit more verbose though)
umbraco.library:NiceUrl($currentPage/data[@alias='testLink'])
Hope this helps,Dan
Thanks Dan.
I want to check if 'hobOptions' has a url associated with it (from a content picker) and, if it has, display an image with a link from 'hobOption'
I'm trying to do something like the following...
<xsl:if test="string($currentPage/data[@alias='hobOptions']) != ''"> <xsl:variable name="url" select="umbraco.library:NiceUrl($currentPage/data[@alias='hobOptions'], 0)"/> <li> <a href="{$url}"><img src="/media/53/hob_options.jpg" /></a> </li></xsl:if>
but I'm getting an error on my page "Error parsing XSLT file: \xslt\ProductOptions.xslt"
So I think I'm missing something but i'm not sure what!
Thanks,
Rachel
You could try this one out:
<xsl:if test="$currentPage/data[@alias='hobOptions'] != ''"> <xsl:variable name="url" select="umbraco.library:NiceUrl($currentPage/data[@alias='hobOptions'])"/> <li> <a href="{$url}"><img src="/media/53/hob_options.jpg" /></a> </li></xsl:if>
This should work. You shouldn't use the last ", 0" in the umbraco.library:NiceUrl.
Hope this works :)
/Kim A
Thanks Kim, works like a charm!
I was confused as previously I had been trying to do a similar thing with GetMedia.
Thanks for your help.
Good to hear Rachel. Glad I could help...
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Get URL of content picker
Hi,
If
gets the url of the current page, how do I get the url that I have just picked in a content picker where the alias is 'testlink' for example?
I've tried along the lines of
but I just get an error when saving the xslt file.
Thanks,
Rachel
Hi Rachel
$currentPage has a capital P, so this will probably be causing you issues. For posterity, here's what I use (a bit more verbose though)
Hope this helps,
Dan
Thanks Dan.
I want to check if 'hobOptions' has a url associated with it (from a content picker) and, if it has, display an image with a link from 'hobOption'
I'm trying to do something like the following...
but I'm getting an error on my page "Error parsing XSLT file: \xslt\ProductOptions.xslt"
So I think I'm missing something but i'm not sure what!
Thanks,
Rachel
Hi Rachel
You could try this one out:
This should work. You shouldn't use the last ", 0" in the umbraco.library:NiceUrl.
Hope this works :)
/Kim A
Thanks Kim, works like a charm!
I was confused as previously I had been trying to do a similar thing with GetMedia.
Thanks for your help.
Rachel
Good to hear Rachel. Glad I could help...
/Kim A
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.