views:

65

answers:

0

I'm writing an application in Django and I want every page to contain a bread crumb.

The bread crumb needs to look like "Group A > Group A.1 > Group A.1.1". On each page the bread crumb will be different.

Group is a model. The thing confusing me is getting the group object into the context. I am considering writing a context processor that uses a regular expression on the URL to deduce which group object the page is related to. I feel like there is probably a simpler way.

How do I pass this information to the template without specifying these values in every view function? Is there a way for a template's context to figure out where on the site I am?