Skip to content

Using includes with different context #58

@DavidLibeau

Description

@DavidLibeau

Hi,
I've got this type of data

{
    user: {
        name: "David"
    },
    message: {
        text: "Cool day with friends."
        mentions: {
            user: {
                name: "John"
            },
            user: {
                name: "Maria"
            }
        }
    }
}

And I want to use a template to render the message with included templates to render the users. So how can I use the Mark.includes thing but with different context ?

In final, I would add something like this to my template :

Message from {{renderUser(user)}}: {{message}} (with {{mentions}}{{renderUser(.)}} {{/mentions}})

Any ideas ? 😃

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