Copied to clipboard

Flag this post as spam?

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


  • Dave 48 posts 68 karma points
    Jul 15, 2011 @ 12:41
    Dave
    0

    Yet more grief with GetMedia in 4.5.2

    I have been trying to work out why I get no media item returned from a macro when the textmultiline and the text are fine.

    Trying to debug the problem using

    <xsl:copy-of select="/macro" />

    and all get back is the content of the macro with no xml separators!

    I have 3 that should be coming back, a mediacurrent (an image (mediaimg)), a text multiline (a bit of text (txt)), and a text (a link (linkurl)).

    The XSLT is :

    =================================================

    <xsl:variable name="MediaID" select="/macro/mediaimg" />
    <div class="pimg">
    <div class="imgdiv">
    <a>
    <xsl:attribute name="href">
    <xsl:value-of select="/macro/linkurl" />
    </xsl:attribute>
    <xsl:choose>
    <xsl:when test="$MediaID &gt; ''">
    <img>
    <xsl:attribute name="src">
    <xsl:value-of select="umbraco.library:GetMedia($MediaID, 0)/umbracoFile" />
    </xsl:attribute>
    <xsl:attribute name="alt">Image</xsl:attribute>
    </img>
    </xsl:when>
    <xsl:otherwise><br /><br /><br /><br /><br /><br />
    <xsl:value-of select="$MediaID" />
    </xsl:otherwise>
    </xsl:choose>
    </a>
    </div>
    <p>
    <xsl:value-of disable-output-escaping="yes" select="/macro/txt" />
    </p>
    <div class="clear">
    <xsl:text>

    </xsl:text>
    </div>
    </div>

    =============================================

    The output of the debug is (its actually concatenated - I put the line breaks in to show more clearly where the breaks appear!)

    ==================================

    /media/568/light.gif44431694gif

    <b>Conceptual Design</b> The prime purpose of your web site is to drive business growth and we design growth driving strategies every step of the way. We plan your site to attract the right customers or stakeholders, to make it easy for them to engage or buy, and to enhance your customer service to ensure repeat visits. <a href='http://www.fusioninternetsolutions.com/web-application-development/conceptual-design.aspx'>Learn more ></a>

    http://www.fusioninternetsolutions.com/web-application-development/conceptual-design.aspx

    ==================================

  • Dave 48 posts 68 karma points
    Jul 15, 2011 @ 12:51
    Dave
    0

    Solved it with help from this

    http://our.umbraco.org/forum/developers/xslt/14874-Problem-with-getmedia-452

    page

    Thanks guys

    Dave

Please Sign in or register to post replies

Write your reply to:

Draft