<div class="page-heading {{ extra_class }}">
<h1>{% block heading %}{% endblock %}</h1>
</div>
{% use "page_header.html" %}
{% block heading %}Some Title{% endblock %}
{% enduse %}
{% use "page_header.html" with extra_class="large" %}
{% block heading %}Some Title{% endblock %}
{% enduse %}
{% use "page_header.html" only %}
{% block heading %}Some Title{% endblock %}
{% enduse %}
{% use "page_header.html" with extra_class="large" only %}
{% block heading %}Some Title{% endblock %}
{% enduse %}
<div class="page-heading">
<h1>{% block heading %}{% endblock %}</h1>
{% if used_blocks.sub_heading %}
<h2>{% block sub_heading %}{% endblock %}<h2>
{% endif %}
</div>
{% use "page_header.html" %}
{% block heading %}My Page Title{% endblock %}
{% enduse %}
{% use "page_header.html" block heading %}
My Page Title
{% enduse %}
--
You received this message because you are subscribed to the Google Groups "Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-develop...@googlegroups.com.
To post to this group, send email to django-d...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/0104008b-bb58-4730-a0dd-43c2875fa1b5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-develop...@googlegroups.com.
To post to this group, send email to django-d...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/bb252615-f881-4233-a69b-ae40faf3a694%40googlegroups.com.
# page_heading.html
<div class="page-heading">
<h1>{% block heading %}My Heading{% endblock %}</h1>
<h2>{% block sub_heading %}My Subheading{% endblock %}<h2>
</div>
# base_page.html
...
{% use 'page_heading.html' ns page_heading %}
<h1>{% block heading %}Basic Page Heading{% endblock %}</h1>
{% enduse %}
...
# actual_page.html
{% extends 'base_page.html' %}
{% block page_heading.heading %}Basic Page Heading{% endblock %}
# base.html
<html>
<head>
{% use 'head.html' ns global %}{% enduse %}
</head>
<body>
...
</body>
</html>
# head.html
<title>{% block title %}{% endblock %}</title>
# actual_page.html
{% extends 'base.html' %}
{% block title %}My Page Title{% endblock %}
{% use 'head.html' ns html_head %}{% enduse %}
# actual_page.html
{% extends 'base.html' %}
{% block html_head.title %}My Page Title{% endblock %}
# modal.html
<div class="modal fade {{ extra_class }}"
id="{{ modal_id }}"
tabindex="-1"
role="dialog"
{% if used_block.header %}aria-labelledby="{{ modal_id }}_label"{% endif %}
aria-hidden="true"
>
<div class="modal-dialog">
<div class="modal-content">
{% if used_block.header %}
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
<h4 class="modal-title" id="{{ modal_id }}_label">{% block title %}{% endblock %}</h4>
</div>
{% endif %}
{% if used_block.body %}
<div class="modal-body">
{% block body %}{% endblock %}
</div>
{% endif %}
{% if used_block.footer %}
<div class="modal-footer">
{% block footer %}{% endblock %}
</div>
{% endif %}
</div>
</div>
</div>
# my_page.html
{% use 'modal.html' with modal_id='settings_modal' %}
{% block title %}
Your Settings
{% endblock %}
{% block body %}
... A settings form? ...
{% endblock %}
{% block footer %}
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save changes</button>
{% endblock %}
{% enduse %}
{% use 'modal.html' with extra_class='large' modal_id='annother_modal' %}
{% block title %}
Another Modal
{% endblock %}
{% block body %}
This one has no footer/
{% endblock %}
{% enduse %}
{% use 'modal.html' with extra_class='small' block body %}
This one doesn't even have a title, and as we are just overriding a single block we loose the block tags.
{% enduse %}