Skip to content

How to use template engine #344

Open

Description

@ju2pom

Hello,
I'm beginning a web prototype and I d'like to use a template engine like nunjucks.
I manage to render some piece of template inside a section's code this way:

load section#browse': function(event) {
  var items = [{ title: "foo", id: 1 }, { title: "bar", id: 2}];
  var res = nunjucks.render('test.html', { tree: items });

  Lungo.dom("#placeholder").html(res);
}

But I don't want to replace an element's inner html, I would prefer to have a template for the html file containing the section. But I don't know how to do it. I tried to replace the section's inner html, but then I got a black view.

I could not find any help about that in the documentation or on the web.

Thanks for any help,
Julien.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions