Override blocks in included templates
Project description
This package adds the {% embed %} templatetag. This tag combines the functionality of the include tag and the extends tag to allow for more flexible and extensible modular template usage. Inspired by twig’s embed tag, this tag lets you override blocks that were defined in the included template.
Installation
Simply get the package from pip:
pip install django-embed-template
Then make sure to add django_embed_template to your INSTALLED_APPS in your settings.py.
Usage
Unlike the {% extends %} tag, the {% embed %} tag can be repeated in the template and does not have to occur as the first tag (essentially like the {% includes %} tag). Likewise, {% embed %} inherits the context by default, and allows you to pass additional context using the with keyword. Passing only the explicitly listed variables can be achieved using the only keyword.
TODO add an example
License
This package includes code that was directly derived from code from the Django project. The included django-LICENSE applies to those snippets. The included CC0 license applies to the rest of this project.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for django-embed-template-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a02369b1d7f3e60250305a8cef8af4c204540890f05ff1f3a0f3beb439e3ee01 |
|
MD5 | f36989290038fad2e66669df61efaa10 |
|
BLAKE2b-256 | 531db71f12cf44729aa3d3d806d3a26cfd1f765f832b8e24b5485940eb8ae474 |
Hashes for django_embed_template-0.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4d22465213ee168a86473530906f1ac2025784e2fc5d8055755badc8bd3a5624 |
|
MD5 | 43a83b8825198b3d16c1843647f9f152 |
|
BLAKE2b-256 | 12ad85a4a03849c8234a116d2d9fc4fd900463c06b5e2484bf80bd2fb75df881 |