I've got a navigation menu template I'm including in pretty much every
page of my site, and I want  the content of the menu to vary depending
on where a visitor is located. After poking through the message
archives, it looks like the simplest solution (I don't think I need a
custom template tag) is to include some sort of 'location' variable in
my context, which will propagate down to the nav-bar include template,
where it can do its thing.

For the sake of DRY, I want to generate this variable using a
TEMPLATE_CONTEXT_PROCESSOR, so I don't have to pass it into every view
separately. But when it came time to write the thing I realized I
don't know how the view/URL info is getting included in the
RequestContext. ie:

def current_location(request):
    return {'location': ????}

What do I put in there? I'd be happy with the view, the named url
pattern, the url itself (plus parameters) or the template (ditto), but
don't actually know how that information is being stored at this stage
in the request processing.

Grateful for any help...


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