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,
I guess Xslt will never be my cup of tea.
I have created a documenttype Publication. This documenttype has a property, downloadPublication of datatype MediaPicker.
In the Xslt file to list all publications, I want to create a link from this downloadPublications property like this:
<xsl-if test="$currentPage/publicationDownload != ''"> <a href="{umbraco.library:NiceUrl($currentPage/publicationDownload, false)}">download</a></xsl-if>
alas, after zillions of combinations I still get an xslt error ( Error parsing XSLT file: \xslt\GeneralPublicationsList.xslt)
Can someone help me, I don't know what I'm doing wrong, I just want to create a download link with the property downloadPublication.
Thanks for your help,
Anthony CandaeleBelgium
Hi Anthony,
NiceUrl is only for Content Pages, for Media Items you should use GetMedia and pull the umbracoFile property:
<xsl:if test="$currentPage/publicationDownload != ''"> <a href="{umbraco.library:GetMedia($currentPage/publicationDownload, false())/umbracoFile}">download</a></xsl:if>
Hope this helps,-Tom
Hi Tom,
Thanks a lot, I dropped the $currentPage bit and now this code works!
<xsl:if test="publicationDownload != ''"> <a href="{umbraco.library:GetMedia(publicationDownload, false())/umbracoFile}">download</a> </xsl:if>
greetings,
Anthony
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
cannot create link in Xslt
Hi,
I guess Xslt will never be my cup of tea.
I have created a documenttype Publication. This documenttype has a property, downloadPublication of datatype MediaPicker.
In the Xslt file to list all publications, I want to create a link from this downloadPublications property like this:
<xsl-if test="$currentPage/publicationDownload != ''">
<a href="{umbraco.library:NiceUrl($currentPage/publicationDownload, false)}">download</a>
</xsl-if>
alas, after zillions of combinations I still get an xslt error ( Error parsing XSLT file: \xslt\GeneralPublicationsList.xslt)
Can someone help me, I don't know what I'm doing wrong, I just want to create a download link with the property downloadPublication.
Thanks for your help,
Anthony Candaele
Belgium
Hi Anthony,
NiceUrl is only for Content Pages, for Media Items you should use GetMedia and pull the umbracoFile property:
Hope this helps,
-Tom
Hi Tom,
Thanks a lot, I dropped the $currentPage bit and now this code works!
<xsl:if test="publicationDownload != ''">
<a href="{umbraco.library:GetMedia(publicationDownload, false())/umbracoFile}">download</a>
</xsl:if>
greetings,
Anthony
is working on a reply...