I have first.html:
{% block title %}
hi there
{% endblock %}
{% block content %}
blah-blah
{% endblock %}
{% block footer %}
bye
{% endblock %}
and second.html.
How can I incude all first.html page to second.html and complement content block like this:
hi there
blah-blah
this text is from second.html
bye
I've tryed
{% extends "first.html" %}
this text is from second.html
(just nothing added) and
{% extends "first.html" %}
{% block content %}
this text is from second.html
{% endblock %}
(block content is overrided).
You can make use of {{ block.super }} [Django-doc] here when you want to render the original content as well. For example:
{% extends 'first.html' %}
{% block content %}
{{ block.super }}
this text is from second.html
{% endblock %}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With