I think I need a singleton with a dict like this ...
bread = singleton()
bread.dct['last_title'] =
Within each view and before doing anything else I want to ...
def someview(request):
title = 'whatever'
crumb = bread.dct['last_title']
bread.dct['last_title'] = title
# put title and crumb into the view context for extraction
# in the template as {{title}} and {{crumb}}
Is there a better way?
Thanks
Mike
> Is there a better way?
One thing you can do is a "pure template" based breadcrumb
or pseudo-breadcrumb, assuming you have a template inheritance
graph with different views rendering different templates -
block.super is the key. I'm sure I picked this up in a blog post
somewhere, I didn't originate it:
*** base.html.djt:
<title>{% block title %}EXAMPLE{% endblock %}</title>
and
<div id="breadcrumbs">
{% block breadcrumb %}<a href="/">EXAMPLE</a>{% endblock %}
</div>
*** child.html.djt:
{% extends "base.html.djt" %}
{% block title %}{{ block.super }} :: CHILD{% endblock %}
{% block breadcrumb %}{{ block.super }} » <a href="{% url
proj.app.views.child %}">CHILD</a>{% endblock %}
*** grandchild.html.djt:
{% extends "child.html.djt" %}
{% block title %}{{ block.super }} :: GRANDCHILD{% endblock %}
{% block breadcrumb %}{{ block.super }} » <a href="{% url
proj.app.views.grandchild %}">GRANDCHILD</a>{% endblock %}
You get the idea.