Copied to clipboard

Flag this post as spam?

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


  • Ast35 23 posts 44 karma points
    Feb 01, 2013 @ 13:22
    Ast35
    0

    Setting div background image as inline style in macro, getting URL of image from media picker rather than media id

    OK, here's what I've got so far-

     

    That is setting the background URL as the media ID of the image. I know I probably need to use GetMedia, but the precise syntax is eluding me.

     

    I would appreciate your assistance.

     

    <xsl:for-each select="umbraco.library:GetXmlNodeById('3160')/* [@isDoc and string(umbracoNaviHide) != '1']">  
      
              <div id="fr{@id}" class="featuredbg ui-tabs-panel {./fragmentCSSClass}" style="background: url('{./backgroundImage}')">

                <div class="info {./infoDivCSSClass}">
                  <xsl:value-of select="./sliderContent" disable-output-escaping="yes" />
                </div>
              </div>
    </xsl:for-each>

  • Ast35 23 posts 44 karma points
    Feb 01, 2013 @ 15:38
    Ast35
    0

    I gave up and used an Upload data type instead of a media picker. If anybody does know, I would still be interested.

  • Charles Afford 1163 posts 1709 karma points
    Feb 02, 2013 @ 19:46
    Charles Afford
    0

    Hello :) GetMedia works like this :).

     

    <xsl:variablename="mediaNode"select="umbraco.library:GetMedia($mediaId, 0)"/>

    you can then use:

    $mediaNode/umbracoFile, $mediaNode/umbracoWidth, $UmbracoHeight and other properties.  Hope this helps :)

    Charlie. 

     

     

     

  • 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