Copied to clipboard

Flag this post as spam?

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


  • Nick Warner 5 posts 25 karma points
    Jun 12, 2012 @ 18:57
    Nick Warner
    0

    Macro container to enable link to PDF in Media section

    Hi

    I'm trying to get use a macro container to display a link to a PDF that the user picks with the macro with a mediaCurrent type parameter. If i use:

    <xsl:value-of select="$pdflink" />

    then i get a weird output like this:

    /media/264/sew_wantedposter2011.pdfpdf123766 

    How can i use this to populate the URL so i can create a link like this?

    <a href="{$solution}" class = "seLinkPDF" >MY LINK</a>

    Thanks in advance for any help with this!!

    Nick

  • Nick Warner 5 posts 25 karma points
    Jun 15, 2012 @ 17:57
    Nick Warner
    0

    For anyone else this wasn't too tricky!

            <xsl:variable name="pdfId" select="$pdflink/File/@id" />
            <xsl:if test="$pdfId> 0">
              <href="{umbraco.library:GetMedia($pdfId, 0)/umbracoFile}" class "seLinkPDF"><p><p><xsl:value-of select="$pdflinktext"/></p></p></a>
            </xsl:if>

  • 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