Copied to clipboard

Flag this post as spam?

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


  • Tom Maton 387 posts 660 karma points
    Jan 17, 2011 @ 10:53
    Tom Maton
    0

    Macro parameters not passing through

    Hi All,

    I'm using 4.0.3 on a client site and trying to pass a parameter through a macro into the XSLT

    This is my code:

    <xsl:param name="currentPage"/>
    <xsl:param name="imageFolder" select="/macro/selectedfolder" />

    <xsl:template match="/">
        <xsl:copy-of select="$imageFolder" />
        <xsl:if test="$imageFolder != ''">
        <xsl:for-each select="umbraco.library:GetMedia($imageFolder,'false')/node">
            <xsl:element name="img">
                <xsl:attribute name="alt">
                    <xsl:value-of select="@nodeName"/>
                </xsl:attribute>
                <xsl:attribute name="src">
                    <xsl:value-of select="./data [@alias='umbracoFile']" />
                </xsl:attribute>
            </xsl:element>
        </xsl:for-each>
        </xsl:if>
    </xsl:template>

    But nothing is coming through, the parameter type is mediaCurrent()

    Thanks

    Tom

     

  • Petr Snobelt 923 posts 1535 karma points
    Jan 17, 2011 @ 11:26
    Petr Snobelt
    2

    Try look at macro parameters. Put this before your code, any you can see parameter values

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

    Petr

  • Tom Maton 387 posts 660 karma points
    Jan 17, 2011 @ 12:02
    Tom Maton
    0

    Hi Petr,

    Thats returns <macro />.

    Tom

  • Petr Snobelt 923 posts 1535 karma points
    Jan 17, 2011 @ 12:09
    Petr Snobelt
    0

    Go to macro definition and add macro parameters on parameters tab.

    If you have set it correctly, try post html which call macro and your version of umbraco.

  • Tom Maton 387 posts 660 karma points
    Jan 17, 2011 @ 12:17
    Tom Maton
    0

    Ok, I've added another parameter contentPicker and that is returning a value but the mediaCurrent is always getting lost when getting published.

     

  • Tom Maton 387 posts 660 karma points
    Jan 17, 2011 @ 12:31
    Tom Maton
    0

    Right this is wierd, I've removed it and added it again and now it works!!

    CONFUSED!!

    Thanks for the hint re the textarea

    Tom

     

  • Petr Snobelt 923 posts 1535 karma points
    Jan 17, 2011 @ 13:15
    Petr Snobelt
    0

    I'm glad it help. You can mark one of my answers like solution :-)

  • 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