Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I am trying to retrieve the url to an image using the GetMedia mediapicker.

The code below works fine:

<xsl:for-each select="umbraco.library:GetXmlNodeById(1123)/* [@isDoc]">
  <article>
     <img width="1822" height="600">
       <xsl:attribute name="src">
         <xsl:value-of select="umbraco.library:GetMedia(1139, 0)/umbracoFile" />
       </xsl:attribute>
     </img>
     <div class="contents">
        <h1>
          <xsl:value-of select="bannerHeading1"/>
        </h1>
      </div>
  </article>
</xsl:for-each>

However, if I replace the key line with this:

<xsl:value-of select="umbraco.library:GetMedia(bannerImage, 0)/umbracoFile" />

I get a parsing error.

Is there a way I can pass in the property I want? The value of "bannerImage" is 1139 as I want it to be?

Thanks for any help.

share

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.