Hello everyone,
I am using a for each loop in my Template. Within that loop I want to pass the element specific data to a child template. However, when accessing the passed data from one of the child templates, they all have the same data (and not e.g. the elements respective name). get_elements
and get_other_elements
both return fetched MongoDB documents. The name of the element is displayed correctly.
{{#each get_elements}}
<li>
<h3 class="level-3 rectangle">
{{name}}{{> childTemplate elemID=_id elemName=name}}
</h3>
<ol class="level-4-wrapper">
{{#each get_other_elements _id}}
<li>
<h4 class="level-4 rectangle">
{{name}}
{{ > anotherChildTemplate data=this}}
</h4>
</li>
{{/each}}
</ol>
</li>
{{/each}}
What am I doing wrong?
Any help/hint is highly appreciated. Thank you!