Pylons / pyramid_layout

Pyramid add-on for managing UI layouts.
Other
24 stars 26 forks source link

Using panel inside a jinja2 template #31

Closed robertlagrant closed 9 years ago

robertlagrant commented 9 years ago

I'm using pyramid_fullauth's mako-based templates inside a panel, which I'm then including inside a jinja2 template, which has a jinja2 layout.

Here's the jinja2 template, panel syntax guessed from the pyramid_layout docs:

{% extends main_template %}
{% block body %}
{% panel('login_panel') %}
{% endblock %}

But I get the following error:

jinja2.exceptions.TemplateSyntaxError: Encountered unknown tag 'panel'. Jinja was looking for the following tags: 'endblock'. The innermost block that needs to be closed is 'block'.

Is this a bug? Or did I try the wrong syntax?

Thanks!

robertlagrant commented 9 years ago

Worked it out, sorry. I needed to use {{ }} instead of {% %} around the panel call. Might be worth updating the docs to say this explicitly?