#9173: Conditional content of template blocks
-----------------------------+----------------------------------------------
Reporter: while0pass | Owner: nobody
Status: new | Milestone:
Component: Template system | Version: 1.0
Keywords: | Stage: Unreviewed
Has_patch: 0 |
-----------------------------+----------------------------------------------
It will be very good if there is some possibility to mark sort of
"conditional content" of the template blocks ({% block .. %}), that is the
content that is displayed only if in a child template the block has some
content. For instance, we have 2 templates:
{{{
parent.html
<table>
<tr>
<td>{% block firstcol %}{% endblock %}</td>
<td>{% block secondcol %}{% endblock %}</td>
{% block thirdcol %}<td>{% blockcontent %}</td>{% endblock %}
</tr>
</table>
}}}
{{{
child.html
{% extends 'parent.html' %}
{% block firstcol %} 1 {% endblock %}
{% block firstcol %} 2 {% endblock %}
}}}
We should have such an output text:
{{{
<table>
<tr>
<td> 1 </td>
<td> 2 </td>
</tr>
</table>
}}}
but not the following:
{{{
<table>
<tr>
<td> 1 </td>
<td> 2 </td>
<td></td>
</tr>
</table>
}}}
--
Ticket URL: <http://code.djangoproject.com/ticket/9173>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---