On Tue, 2009-01-20 at 11:11 -0800, Flo Ledermann wrote: > Hi all, > > in my templates I often use combinations of "with...as" and "include" > for modularization of HTML building blocks, like so: > > {% with "save" as label %}{% include "components/button.html" %}{% > endwith %} > > however, this is a bit cumbersome if used frequently or if multiple > variables must be set using nested "with...as" blocks. Wouldn't it > make sense to support a syntax like > > {% include "components/button.html" with "save" as label, foo as bar > %} > > to support modularization of templates? Or is there another technique > to do things like that in a readable and straightforward way?
Well, one man's readable is another man's "good grief, that line is becoming massively long and unreadable!" Django's design tries hard to make template tags short. That helps support the wish that they shouldn't contain newlines, for example. > I > wouldn't want to write a custom template tag for things that only > concern presentation and can be done entirely in the template > language. Huh? You have some change you want to make to the way a template tag behaves, but you don't want to write a custom template tag to do that? That doesn't sound very logical. If you want template tag behaviour, use a template tag. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---