Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
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.
goed=good offcourse :)
(mm.... where the edit option)
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
Dirk, Thanks for your suggestion. I did solve my problem this way!
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?
Chris
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
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 :
We would like to have something like :
But that doesn't work.
Anyone goed ideas?
Thanks Walter.
goed=good offcourse :)
(mm.... where the edit option)
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
Dirk, Thanks for your suggestion. I did solve my problem this way!
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
In my Translate Macro I have this:
and then in the template further down I have...
however everything else in the template works - what am I doing wrong?
Cheers,
Chris
is working on a reply...