On Mon, Jun 8, 2009 at 3:19 PM, pingwin <ping...@gmail.com> wrote: > > Hi, > > This is frustrating and against a true MVC methodology. I want to have > something like this for the designer in the template. > > {% if user.is_authenticated %} > {% extends "auth_base.html" %} > {% else %} > {% extends "base.html" %} > {% endif %} > > However this obviously fails. I do not think it makes since to have a > designer muddling around in python code (that he/she does not > understand) to figure out or edit to make this behavior. > > So ummmm... yeah what are some real options so I don't have to teach > the designer python just so they can edit the html files? > > Thanks > > > > While you can't wrap extends in a conditional it can take a variable. So you can just set the variable in the view for which template it is supposed to extend (you could even use a template context process to stay DRY).
Alex -- "I disapprove of what you say, but I will defend to the death your right to say it." --Voltaire "The people's good is the highest law."--Cicero --~--~---------~--~----~------------~-------~--~----~ 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 django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---