This is a simple template macro tag, that adds the ability of repeating template blocks within a template file.
You need to repeat a block, but you cannot:
<title>{% block site_title %}{{ title }} of this page{% endblock %}</title> <h1>{% block site_title_2 %}{{ title }} of this page{% endblock %}</h1>
You can repeat the block you need:
{% load repeatblock %} <title>{% block site_title %}{{ title }} of this page{% endblock %}</title> <h1>{% repeatblock site_title %}</h1>
pip install -e 'git+https://github.com/phretor/django-repeatblock.git#egg=django-repeatblock'
- Add
'repeatblock'
to yourINSTALLED_APPS
setting.
Check out the testapp/templates/
folder.