Skip to content

Access parent data from a nested template #116

@StrouMfios

Description

@StrouMfios

I am trying to access the parent data from a nested template but I am getting "Error: data.parent is undefined"

In my 'master' template I have the declaration

{{for Rooms tmpl="#RoomTmpl" layout=true /}}

and in the #RoomTmpl

<script id="RoomTmpl" type="text/x-jsrender"> {{:parent.parent.data.Room1Label}} (Here is the error) {{for #data}} {{:RoomName}} {{/for}} </script>

I tried also this {{:#parent.parent.Room1Label}} but with no luck

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions