> 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

Jinja's approach does not work with the Django templates.
- The whitespace in the template tags does not work well.
- Calling the macro method as a Variable instead of using a template
tag can probably not be done without rewriting compile_filter
(variable resolving from context) from scratch. I'm not sure about
this.

I think passing variables to includes has been discussed before, and
if we implement the {% macro %} tag, it should be done in a consistent
way.

Currently, you would do:

{% with "var" as variable %}
  {% callmacro "macro_name" %}
{% endwith %}

-- 
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