I've run into this problem.

I have a base template and I use a lot of macros.  The macros take
parameters.  The base template uses those macros.

So in my base.html, I have something like:

{% import 'macros.html' as m %}

then later:

{{ m.draw_navigation(user) }}

And that user object is passed into the template from my controller.
The template that the controller gets and renders is not base.html --
maybe it is about.html, which happens to extend base.html.

As long as about.html gets a user object during render time, then
AFAIK, base.html gets the same stuff.

This approach works well for me.

Passing in the user object as a parameter allows me to do intelligent
stuff like show different links depending on the user's preferences or
privileges.

HTH

Matt

-- 
You received this message because you are subscribed to the Google Groups 
"pocoo-libs" 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/pocoo-libs?hl=en.

Reply via email to