Copied to clipboard

Flag this post as spam?

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


  • Eric Avery 1 post 21 karma points
    Jun 07, 2011 @ 22:42
    Eric Avery
    0

    Image URL: Pulling from the Media Folder

    I want to pull an image out of the media folder by using the ParentID of the current page... So it is an image for a given section.  I am at wits end.  I have created an XSLT and a macro... but all I ever get is parse errors.  I am really trying to do this in XSLT vs C# or hard coding.

    I am seriously lacking something here...can someone point the way?

  • Sebastian Dammark 583 posts 1407 karma points
    Jun 08, 2011 @ 12:52
    Sebastian Dammark
    0

    You need the folderid or the imageid to get anything from the media section.

    Show us your XSLT and we might be able to help you

  • Martin Rud 258 posts 989 karma points c-trib
    Jun 08, 2011 @ 14:16
    Martin Rud
    0

    Hi Eric,

    If I understand you correctly you wan´t to display an image from an upper level. I havde made something similar: A have a media picker property on my pages (pageimage):

    <xsl:variable name="item" select="$currentPage/ancestor-or-self::* [@isDoc][string(pageimage)!=''] [position()=1] /pageimage" />

      <xsl:if test="$item != ''">

        <xsl:variable name="image" select="umbraco.library:GetMedia($item, 1)" />

      <img src="{$image/umbracoFile}" />

      </xsl:if>

     

    I an image is picked on an upper level it wil be rendered on the current page.

    Hope it makes sense.

     

    Regards,

    Martin

     

     

Please Sign in or register to post replies

Write your reply to:

Draft