Hi,
I have a dynamic template that is rendering a set of templates in an array, like this:
{{#each contentItem in contentItems}}
{{> Template.dynamic template=contentItem data=person}}
{{/each}}
This works correctly, and my ‘contentItem’ template is rendered. The data context is set to ‘person’ which is an object in the template. ‘person’ has fields like, name, phone, etc.
In my child template, I now have access to {{ name}}, {{phone}}, etc.
What I would really like is to have that data context in the child template to be like {{person.name}}, {{person.phone}} etc, as I use this explicit data context as a standard throughout my app.
I guess I’m looking for something like:
{{#each contentItem in contentItems}}
{{> Template.dynamic template=contentItem data.person=person}}
{{/each}}
or
{{#each contentItem in contentItems}}
{{> Template.dynamic template=contentItem data={person: person}}
{{/each}}
Is there a standard way of achieving this? I suppose I could have a helper that returns a nested object, but I thought maybe there is a better way.