Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Anthony Candaele 1197 posts 2049 karma points
    May 18, 2011 @ 15:34
    Anthony Candaele
    0

    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

  • Tom Fulton 2030 posts 4998 karma points c-trib
    May 18, 2011 @ 15:49
    Tom Fulton
    1

    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

  • Anthony Candaele 1197 posts 2049 karma points
    May 18, 2011 @ 16:06
    Anthony Candaele
    0

    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

  • 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.

Please Sign in or register to post replies