[EMAIL PROTECTED] wrote: > I'm using django.views.generic.list_detail.object_detail to show a > page. Beside text it has optional "leftmenu" field. What I want to do > is to show it in a html block if it exists (there is somethign in > "leftmenu"). The problem is that it shows always or never. > > I have: > ################### > {% if object.leftmenu %} > {% block leftmenu %} > <div class="navouter"> > <div class="orange"></div> > <div class="navheader">Menu Strony</div> > <div class="navcontent"> > {{ object.leftmenu|restructuredtext }} > </div> > </div> > {% endblock %} > {% endif %} > #################### > And it shows always.
This might be or might not be the case but what is definitely wrong here is that all content in a template extending some parent template should go inside {% block %}. Put your {% if %} like this: {% block leftmenu %} {% if object.leftmenu %} {% endif %} {% endblock %} I believe that the other way around {% if %} is just ignored... --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---