In GTL you can pass parameters to templates, but they need to be values (no %variable% allowed). Is there a way to deference an attribute in the call? E.g., %templateTakingParams(%!table.column.Name%)%. Right now I'm creating a model-level variable before the call and using that, but it seems like a hack.
Turns out you can pass variables.
Pass the variable without the percent signs. For %variable%, use %template(variable)%.
Then dereference it inside the template with %*@1%.
You're right, you can't pass a variable to a template - I tried it recently. I had to create an extended attibute to pass instead, like you did.
Add a comment