velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Charles Harvey III <charl...@alloy.com>
Subject macro variables
Date Thu, 30 Jul 2009 17:37:42 GMT
Hello.
I am setting a variable in my macros.vm file and trying to print it in 
my template and it does
not display.  I was wondering if I was doing something wrong or if there 
is a bug.


macros.vm:
---------------------------------------------------------
#macro( testing )
    #set( $myVar = "testing" )
    macro myVar: $myVar<br />
#end
---------------------------------------------------------


template.vm
---------------------------------------------------------
#testing()
template myVar: $myVar<br /><br />
---------------------------------------------------------


velocity.properties
---------------------------------------------------------
velocimacro.library = /macros.vm
velocimacro.library.autoreload = true
velocimacro.permissions.allow.inline = true
velocimacro.permissions.allow.inline.to.replace.global = true
velocimacro.permissions.allow.inline.local.scope = true
velocimacro.context.localscope = true
---------------------------------------------------------


output:
---------------------------------------------------------
macro myVar: testing
template myVar: $myVar
---------------------------------------------------------


Am I doing something wrong?  Shouldn't this work?  Thanks for the help.


Charlie



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org


Mime
View raw message