Breadcrumbs in Django apps
/*--- holy mAcar00ns!! --- */
Django users |
Google Groups: "The breadcrumbs for your own apps should not involve pulling anything
from the admin. �Just put the top two breadcrumbs (/ and /mysite) in
your site-wide base.html, then pull that into your app templates using
{{ block.super }} and append the app-specific breadcrumbs.
Carl"
That sounds ike a good idea.
This one looks way more complicated than it needs to be.
Here's an option for flatpages:
Custom template filter to generate a breadcrumb trail for a flatpage. Say you have a series of flatpages with URLs like /trunk/branch/leaf/ etc. This filter looks at the URL of a given flatpage, figures out which of the leftwards text chunks correspond to other flatpages, and generates a string of anchored HTML.
Usage:
{% load make_breadcrumb_trail %}
{{ flatpage.url|crumbs:flatpage.title }}
This one also seems a bit complicated.
This is a fairly simple way to do it.
And this is the simplest way to do it I think:
{% block breadcrumb %}{{ block.super }} » {{ object.title|title }}{% endblock %}
all your bases ar--
ping moi pleeez
About this entry
You’re reading “
- Published:
- 7:35 PM
pacman is coming
nuck nuck
e belong to us!
1 Comments (Post a Comment)