Maybe I missed something in the docs or the FAQ, but...
Is there a way to pass different variables to an {% include %}?

Say I want to have a reusable component, included via {% include %},
which renders a product. So I only have to deal with layout,
formatting, images, etc., once (I'm a big fan of re-use and DRY). The
template fragment will have a lot of {{product.price}},
{{product.picture}}, {{product.nunmInStock}}, etc.

BUT -- not all my templates will have the product I want to render in a
context variable called "product". Some will have it in
"shoppingCartEntry", some in "bestOffer", some maybe even in a {% for
etnries in shoppingcart %}....{% endfor %} -- depending on the context.
But it's always a product.

This would mean I would have to assign different context variables to
my {%include%}'s  "product" variable.

Is this supported? Did I miss it in the docs? Or is this not possible
at the moment?

Daniel


--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to