lib/helpers.py
changeset 28 b68145b5ce24
parent 26 9d3beac1b196
child 29 b06ff4c05d42
--- a/lib/helpers.py	Sat Feb 07 05:05:29 2009 +0200
+++ b/lib/helpers.py	Sat Feb 07 05:12:57 2009 +0200
@@ -13,3 +13,14 @@
 
     return time.strftime(config.DATETIME_FMT)
 
+def breadcrumb (trail, links=True) :
+    """
+        Returns a nicely formatted breadcrumb tail, optinally with links
+    """
+
+    return ' » '.join(
+        (
+            '<a href="$site_url/%s">%s</a>' % (page.url, page.title) if links else page.title
+        ) for page in trail
+    )
+