Copied to clipboard

Flag this post as spam?

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


  • Profiterole 232 posts 264 karma points
    Jun 09, 2010 @ 21:05
    Profiterole
    0

    xslt not getting macro parameter

    Hi, here's my problem. In my masterpage, I call a macro that should displays img and the width is the macro parameter:

    <umbraco:Macro width="25px" Alias="AP_buttons" runat="server"></umbraco:Macro>

    Here my xslt :

    <xsl:param name="currentPage"/>
    <xsl:variable name="width" select="/macro/width" />

    <xsl:template match="/">

    <!-- start writing XSLT -->
    <table border="0" style="padding-top:8px;">
    <tr>
    <td><img width="{$width}" src="/AP/layout/facebook.jpg" alt="Facebook"/></td>

    But it doesn't work. If a change /macro/width by, for instance, 10, my img got 10px as width. But, the xslt doesn't get the value entered in masterpage. Do you see the problem?

    Thank you

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Jun 09, 2010 @ 21:33
    Dirk De Grave
    0

    Hi Profiterole,

    Quick check: Do you have a macro parameter who's alias is 'width' (Ok, stupid question, but may want to check it anyway)

    If that's ok, did you try changing the name of the parameter, eg. ImgWidth instead of width?

     

    Looking forward to your tests.

     

    Cheers,

    /Dirk

     

  • Profiterole 232 posts 264 karma points
    Jun 10, 2010 @ 01:40
    Profiterole
    0

    Ok, you got it!! I have 2 macro with width parameter. So I changed one to imgwidth and it works!! You're the king!

Please Sign in or register to post replies

Write your reply to:

Draft