Skip to Content

Dereference an Attribute for Template Parameter

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.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Best Answer
    Aug 28 at 11:50 AM

    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%.

    Add comment
    10|10000 characters needed characters exceeded

  • Aug 08 at 02:01 PM

    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 comment
    10|10000 characters needed characters exceeded