Mike Dewhirst wrote:
> I would like to get breadcrumbs working in a simple way. Could anyone 
> please help?

> 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 }} &raquo; <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 }} &raquo; <a href="{% url
proj.app.views.grandchild %}">GRANDCHILD</a>{% endblock %}



You get the idea.



--~--~---------~--~----~------------~-------~--~----~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to