2

I have 3 sets of globals, which use the same fields handles.

{{ firstGlobalHandle.aFieldHandle }}
{{ secondGlobalHandle.aFieldHandle }}
{{ thirdGlobalHandle.aFieldHandle }}

In a child template, I set a variable corresponding to the handle of the global group which I need to call

{% set globalHandle = "secondGlobalHandle" %}

Now in the In the parent template, I would like to do the following :

{{ '{{ globalHandle }}'.aFieldHandle }}

Is there any way to do so ?

1 Answer 1

2

OK, my bad, this was answered here

Here is the solution :

{{ _context[ globalHandle ].aFieldHandle }}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.