Copied to clipboard

Flag this post as spam?

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


  • Jesper Ordrup 1019 posts 1528 karma points MVP
    Aug 09, 2011 @ 18:44
    Jesper Ordrup
    0

    Hi sir,

    Fantastic project. Thanks for sharing it.

    I'm using the damp multi with "Full media xml". This is brilliant as I then have the xml directy. And it all works when selecting the property directly in xslt.

    But if I choose to use specify which field to use in a macro paramenter then the value is always empty?

    Best
    Jesper

  • Jesper Ordrup 1019 posts 1528 karma points MVP
    Aug 09, 2011 @ 21:48
    Jesper Ordrup
    0

    To clarify:

     

    If I do like this:

     <umbraco:Macro Alias="Stan_topimage" imgFile="[$topImage]" runat="server"></umbraco:Macro>

    .. and add imgFile as parameter to the macro ... then 

    <xsl:value-of select="/macro/imgFile"/> returns nothing

    but 

    <xsl:value-of select="$currentPage/topImage"/> works.

    Best

    Jesper

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Aug 09, 2011 @ 21:57
    Tom Fulton
    1

    Hi Jesper,

    If I recall, you can't pass in XML data through macro parameter syntax, so the same thing happens for datatypes like Related Links.

    To work around this in the past I've instead passed in the alias of the property and retrieved the data from XSLT.

     <umbraco:Macro Alias="Stan_topimage" imgFileField="topImageField" runat="server"></umbraco:Macro>

    And in xslt:

    <xsl:param name="imgFileField" select="/macro/imgFileField" />
    <xsl:value-of select="$currentPage/* [not(@isDoc)][local-name() = $imgFileField]/DAMP/mediaItem/Image/umbracoFile"/>

    You could check recursively in the XSLT also.

    -Tom

     

  • Jeroen Breuer 4908 posts 12265 karma points MVP 4x admin c-trib
    Aug 09, 2011 @ 22:24
    Jeroen Breuer
    0

    Tom is right. You can't pass xml as a macro parameter. I think nowadays that's the only thing xml properties don´t support. You can get it with an XPath, the node factory or LinqToUmbraco. It´s your choice :).

    Jeroen

  • Jesper Ordrup 1019 posts 1528 karma points MVP
    Aug 10, 2011 @ 16:45
    Jesper Ordrup
    0

    Thanks Tom and jeroen,

    I'll fetch it in xslt then. 

    Best

    Jesper

Please Sign in or register to post replies

Write your reply to:

Draft