My understanding is that you cannot. The docs say that extends, if present must be the first thing in the file (whitespace and maybe comments notsithstanding).
But you could easily enough contrive the particular kind of control in your example by using if tags in base.html (or something that it in turn extends). You probably want to reverse the sense of the test, however to something like if no hide_header, so that unaware view/template combinations that extend base.html get the header by default. Bill On Wed, Jan 20, 2010 at 11:09 AM, Stodge <sto...@gmail.com> wrote: > Can I wrap the "extends" tag in an "if" tag? I tried it but I get: > > Invalid block tag: 'endif' > > {% if show_header %} > {% extends "base.html" %} > {% endif %} > > Is there another way of doing this? I want my view to control whether > the header is displayed or not. Thanks > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-us...@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > > >
-- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.