On Fri, Jan 7, 2011 at 5:18 PM, Dougal Matthews <[email protected]> wrote:
> On Friday, 7 January 2011 at 16:11, Jonathan S wrote:
>
> ** And a {% decorate %} template tag:
> http://paste.pocoo.org/show/316593/
>
> I think they are generic enough to be included.
> {% decorate %} implements a commonly used design pattern. (Also known
> by XAML programmers.) It avoids the need of having to split a template
> into a head.html and footer.html, which is a bad practice, because it
> separates matching opening and closing tags over two files.
>
> Can you explain what advantage the decorate tag has over regular old
> template inheritance?
> I don't think I've ever felt the need to use head.html and footer.html
> Dougal
>

Regarding the macro-tag I think the idea is valid but I'd personally
prefer a more flexible approach regarding variables being  provided
for the macro block. Something like Jinja's macro comes to mind where
I can define parameters for each macro and then pass them in as needed
[1]. This would also provide a use-case that template includes don't
really try to solve.

[1] http://jinja.pocoo.org/templates/#macros

- Horst

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.

Reply via email to