Usando if, elif e else dentro do template HTML do Django
This commit is contained in:
@@ -1,7 +1,9 @@
|
|||||||
{% include 'global/partials/head.html' %}
|
{% include 'global/partials/head.html' %}
|
||||||
{% include 'global/partials/menu.html' %}
|
{% include 'global/partials/menu.html' %}
|
||||||
|
|
||||||
<h1>{% block texto %}{% endblock texto %}</h1>
|
{% if text %}
|
||||||
|
<h1>{% block texto %}{% endblock texto %}</h1>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<main class="content">
|
<main class="content">
|
||||||
{% block posts %}{% endblock posts %}
|
{% block posts %}{% endblock posts %}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ def blog(request):
|
|||||||
print('blog')
|
print('blog')
|
||||||
|
|
||||||
context = {
|
context = {
|
||||||
'text': 'Olá blog',
|
# 'text': 'Olá blog',
|
||||||
'posts': posts
|
'posts': posts
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user