Copied to clipboard

Flag this post as spam?

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


  • Walter E. Harms 13 posts 33 karma points
    Jan 05, 2010 @ 14:02
    Walter E. Harms
    0

    Parameters in Macro

    Hi,

    I would like to make a parameter for a macro variable, what should be the best way.

     

    We've tried ;

    Currently we use the macro :

    <umbraco:Macro numberOfItems="5" jaartal="2010" Alias="UitrukItems" runat="server"></umbraco:Macro>

    We would like to have something like :

    <umbraco:Macro numberOfItems="5" jaartal="<%= DateTime.Now.Year %>" Alias="UitrukItems" runat="server"></umbraco:Macro>

    But that doesn't work.

     

    Anyone goed ideas?

     

    Thanks Walter.

     

  • Walter E. Harms 13 posts 33 karma points
    Jan 05, 2010 @ 14:04
    Walter E. Harms
    0

    goed=good offcourse :)

     

    (mm.... where the edit option)

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Jan 05, 2010 @ 14:15
    Dirk De Grave
    1

    Walter,

    Don't pass it to your xslt or user control from your macro, but fetch the current date IN your user control (.net code as in your snippet) or xslt (some date extension functions available).

     

    Cheers,

    /Dirk

  • Walter E. Harms 13 posts 33 karma points
    Jan 07, 2010 @ 09:20
    Walter E. Harms
    0

    Dirk, Thanks for your suggestion. I did solve my problem this way!

  • Chris Hardy 2 posts 22 karma points
    Jan 07, 2010 @ 12:54
    Chris Hardy
    0

    I've got a problem with the macro and parameters but thought I'd continue on this thread.

    In my template (RunwayTextpage.master) I have this Macro

    <umbraco:Macro Alias="Translate" runat="server" datasource="100" />

    In my Translate Macro I have this:

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

    and then in the template further down I have...

    <xsl:value-of select="$datasource"/>

    however everything else in the template works - what am I doing wrong?

    Cheers,

    Chris

Please Sign in or register to post replies

Write your reply to:

Draft