Malcolm, thanks for the response.
here is the relevant part of my template in a simplified form:
{% if my_list %}
{% block head-extra %}
{{ block.super }}
<script src="{{media_url}}js/prototype.js" type="text/javascript"></
script>
{% endblock %}
{% endif %}
if my_list is empty, it still renders the <script> element. this one
does not:
{% block head-extra %}
{{ block.super }}
{% if my_list %}
<script src="{{media_url}}js/prototype.js" type="text/
javascript"></script>
{% endif %}
{% endblock %}
On Nov 14, 11:57 pm, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Fri, 2008-11-14 at 20:45 -0800, akonsu wrote:
> > hello,
>
> > i noticed that if i put {%block%} tag inside {%if%} tag in my
> > template, the contents of the block gets rendered even when the {%if%}
> > test fails. is this a bug?
>
> It sounds like a bug in the way you've written your template. Because
> the body of an if-tag is not rendered if the condition evaluates to
> False. Even it contains a block.
>
> You'll need to provide a (short) code sample of what you're trying to do
> if you need help trying to spot the error.
>
> Regards,
> Malcolm
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" 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-users?hl=en
-~----------~----~----~----~------~----~------~--~---