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 all,
I have a content picker in my document type, and I want to retrieve the "Link to document" property of the picked content in XSLT. Is this possible? If yes, how?
Thanks
Hi,
There's a function built into umbraco.library called NiceUrl that you can use to get a page's URL from it's ID (which the Content Picker stores).
Ex:
<xsl:if test="$currentPage/yourContentPickerPropertyAlias != ''"> <a href="{umbraco.library:NiceUrl($currentPage/yourContentPickerPropertyAlias)}">Link text</a></xsl:if>
If you want to retrieve other properties from the picked page, like it's name, you can use GetXmlNodeById:
<xsl:if test="$currentPage/yourContentPickerPropertyAlias != ''"> <xsl:variable name="pickedPage" select="umbraco.library:GetXmlNodeById($currentPage/yourContentPickerPropertyAlias)"/> <a href="{umbraco.library:NiceUrl($pickedPage/@id)}"> <xsl:value-of select="$pickedPage/@nodeName"/> </a></xsl:if>
Hope this helps,Tom
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Picked content url
Hi all,
I have a content picker in my document type, and I want to retrieve the "Link to document" property of the picked content in XSLT. Is this possible? If yes, how?
Thanks
Hi,
There's a function built into umbraco.library called NiceUrl that you can use to get a page's URL from it's ID (which the Content Picker stores).
Ex:
If you want to retrieve other properties from the picked page, like it's name, you can use GetXmlNodeById:
Hope this helps,
Tom
is working on a reply...