Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

is it possible to exclude footer.html which is included in base.html when I extend base.html/for django

Tags:

html

django

In my base.html, I have {% include 'footer.html' %} and I extend base.html to every page of mine. But for some pages I don't want footer to be there. Is it possible to exclude that footer using some block key word?

like image 779
mike braa Avatar asked Dec 08 '22 23:12

mike braa


1 Answers

You could use a block in your base.html:

# base.html
...
{% block footer %}
    {% include 'footer.html' %}
{% endblock %}

And then in a template where you don't want footer, do this:

# Some template
{% block footer %}
{% endblock %}
like image 124
Gocht Avatar answered May 23 '23 02:05

Gocht