Marc Schipperheyn
2012-12-04 13:59:24 UTC
Hi,
I'm trying and failing to set a request scope variable from within a macro.
I've tried
<#global delayPhoto = 0>
<#macro delayedPhoto photo path type="thumb" >
<#if (.globals.delayPhoto > 0)>
<#global delayPhoto = .globals.delayPhoto + 1>
<#else>
<#global delayPhoto = 1>
[...]
<#global delayPhoto = 0>
<#macro delayedPhoto photo path type="thumb" >
<#if (delayPhoto > 0)>
<#global delayPhoto = delayPhoto + 1>
<#else>
<#global delayPhoto = 1>
[...]
and some other variations but delayPhoto always
remain 0 when the macro is called.
How do I set a request scope variable from within a macro?
I'm trying and failing to set a request scope variable from within a macro.
I've tried
<#global delayPhoto = 0>
<#macro delayedPhoto photo path type="thumb" >
<#if (.globals.delayPhoto > 0)>
<#global delayPhoto = .globals.delayPhoto + 1>
<#else>
<#global delayPhoto = 1>
[...]
<#global delayPhoto = 0>
<#macro delayedPhoto photo path type="thumb" >
<#if (delayPhoto > 0)>
<#global delayPhoto = delayPhoto + 1>
<#else>
<#global delayPhoto = 1>
[...]
and some other variations but delayPhoto always
remain 0 when the macro is called.
How do I set a request scope variable from within a macro?