Hi Tai, On Jul 13, 8:42 pm, Tai Lee <real.hu...@mrmachine.net> wrote: > I wouldn't like to see widget libraries being packaged up with > templates including conditional templates based on doctype. This seems > messy, not friendly to override in your own templates, and effectively > combining what should be multiple separate templates into one.
I agree with you that separate template trees is much better than conditionals. Also, if using conditionals, where does the value come from that the conditional switches on? Part of my idea is that there should be no need for some magic "use this doctype" value to be passed around. > Wouldn't a mechanism that allows the path from which templates are > loaded to be changed benefit both widget libarary authors and the > designers who are implementing those widget libraries? A widget > library author would include and advertise templates for each doctype > they support, e.g. "html4/mywidgetlibrary/forms/datetime.html" and > "xhtml1/mywidgetlibrary/forms/datetime.html", then the designer would > use: Your {% templatedirs %} tag is an intriguing idea in its own right, and certainly could intersect with template-based form rendering, but I'd prefer to keep the two proposals orthogonal. > This gives a lot of flexibility and allows widget library authors to > support multiple doctypes or flavours (not just specific to doctypes), > and designers to pick and choose (or even override at the project > level) the widget templates according to their doctype or preferred > flavour, without Django needing any specific machinery for doctypes or > designers needing to edit any Python code. I totally agree with this. I think very similar results can be achieved in the form-rendering system just with an optional parameter to a "form/render_form" tag that specifies a "base path" for finding template widgets for this form render, as I mentioned above. I think it's better to keep the form-rendering proposal specific to forms, and evaluate {% templatedirs %} separately as a feature proposal on its own merits. Carl -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-develop...@googlegroups.com. To unsubscribe from this group, send email to django-developers+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.