Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested {% block %} #7

Closed
oal opened this issue Jul 6, 2014 · 2 comments
Closed

Nested {% block %} #7

oal opened this issue Jul 6, 2014 · 2 comments
Labels

Comments

@oal
Copy link

oal commented Jul 6, 2014

I tried to set up my templates like this:

- skeleton.html (has basic HTML structure and {% block body %} under <body>)
    - base.html ({% extends "skeleton.html" %} and fills "body" with a header, footer etc, as well as {% block content %})
        - page.html (extends base.html and fills {% block content %}...{% endblock %})

This is valid in Django, and something I often do, but not currently possible with Pongo2:
The 'block' tag can only defined on root level (especially no nesting).

flosch added a commit that referenced this issue Jul 6, 2014
Removed the neccessary to have blocks in the root level. It is still disallowed to have two or more blocks with the same name. Added tests for inheritance (extends/block-tags).
@flosch
Copy link
Owner

flosch commented Jul 6, 2014

Should be fixed now. Can you confirm this?

@oal
Copy link
Author

oal commented Jul 6, 2014

Yes, that's perfect!

@flosch flosch closed this as completed Jul 6, 2014
@flosch flosch added the bug label Jul 16, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants