No, you don't need to use the same template. You are just filling in
some data on every request using the context processor. Its like this:

1) Write a context processor that adds shopping cart info to every
context. Now it can be accessed via {{ cart.items }} or however you
set it up
2) Write templates to use these. For example, if you only want the
shopping cart info in, say, half of your pages, have those pages
extend a template that contains {{ cart.items }} in the header. For
the others, don't.
3) Alternatively, if you *don't* want shopping cart info in all of
your contexts, you can use the additional argument to RequestContext
for just those views where it is used. The docs reference an
"ip_address_processor" that is added this way.

And in answer to your questions:
a) I don't know if it is better to send your shopping cart data to
every template. That depends on your application.
b) Of course there is a way. It is included as request.session in
every view, if you have the session middleware activated. If this
solves your display questions, it is probably easier than creating a
custom processor anyway.

HTH,
 -rob

On Aug 6, 6:29 am, Greg <[EMAIL PROTECTED]> wrote:
> Oggie,
> Thanks for the reply.  So you're saying that it would be better to
> send my shopping cart data to every template through my all my
> view's?  If that's the case then I assume there is no way to send
> request.session information using a custom template?
>
> Thanks
>
> On Aug 3, 4:36 pm, oggie rob <[EMAIL PROTECTED]> wrote:
>
> > If you really need to use a tag, look 
> > athttp://www.djangoproject.com/documentation/templates_python/#passing-...
> > But I think you probably would find it easier to add an extra context
> > processor & avoid the tag altogether.
>
> >  -rob
>
> > On Aug 3, 6:01 am, Greg <[EMAIL PROTECTED]> wrote:
>
> > > Thanks for your help...I'm now able to create a custom tag.  However,
> > > I now seem to have a another problem with custom tags.  How do I send
> > > session information to each template.   I can't use
> > > request.session['cart'] in my custom tag function because it doesn't
> > > have a request parameter.  I always get the error 'global name request
> > > is not defined'


--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to