I have a fairly simple template that I need to make a method call from. However, NVelocity does not seem to evaluate method parameters that themselves are NVelocity variables. Take the following NVelocity template:
#if (--- CONDITION SNIPPED ---)
<blockquote class="column span-4">
I MADE IT!
</blockquote>
#else
<blockquote class="column span-4">
$extensionMethods.TestMethod(${var1})
</blockquote>
#end
In the above template, $extensionMethods
is passed in as an instance of a class and works wonderfully when passing in evaluated numbers (e.g. $extensionMethods.TestMethod(4)
works every time). However, using $var1
causes the entire string to be returned as-is: $extensionMethods.TestMethod(${var1})
.
Is there a way to pass in a variable to a method lazily to get the above template to evaluate correctly?