diff --git a/README.txt b/README.txt
index 3d37044..2d862e4 100755
--- a/README.txt
+++ b/README.txt
@@ -649,6 +649,23 @@ to the bottom, and to the top.
['m111', 'm114', 'm112', 'm113']
+Breadcrumbs
+-----------
+
+ >>> view = NodeView(m112, TestRequest())
+ >>> view.breadcrumbs()
+ []
+
+ >>> loopsRoot.options = ['showBreadcrumbs']
+ >>> m114.nodeType = 'page'
+ >>> m114.target = cc1
+ >>> view = NodeView(m114, TestRequest())
+ >>> view.breadcrumbs()
+ [{'url': 'http://127.0.0.1/loops/views/m1', 'label': u'Menu'},
+ {'url': 'http://127.0.0.1/loops/views/m1/m11', 'label': u'Zope'},
+ {'url': 'http://127.0.0.1/loops/views/m1/m11/m114', 'label': u''}]
+
+
End-user Forms and Special Views
================================
diff --git a/browser/common.py b/browser/common.py
index 762fba1..659fc11 100644
--- a/browser/common.py
+++ b/browser/common.py
@@ -18,8 +18,6 @@
"""
Common base class for loops browser view classes.
-
-$Id$
"""
from cgi import parse_qs, parse_qsl
@@ -146,6 +144,9 @@ class BaseView(GenericView, I18NView):
return self.controller.getTemplateMacros('resource', resource_macros)
#return resource_macros.macros
+ def breadcrumbs(self):
+ return []
+
@Lazy
def name(self):
return getName(self.context)
diff --git a/browser/node.py b/browser/node.py
index 9c4cc9b..5c95f8d 100644
--- a/browser/node.py
+++ b/browser/node.py
@@ -36,7 +36,7 @@ from zope.lifecycleevent import ObjectCreatedEvent, ObjectModifiedEvent
from zope.lifecycleevent import Attributes
from zope.formlib.form import Form, FormFields
from zope.proxy import removeAllProxies
-from zope.publisher.defaultview import getDefaultViewName
+from zope.app.publisher.browser import getDefaultViewName
from zope.security import canAccess, canWrite, checkPermission
from zope.security.proxy import removeSecurityProxy
from zope.traversing.api import getParent, getParents, getPath
@@ -91,6 +91,10 @@ class NodeView(BaseView):
self.recordAccess()
return result
+ @Lazy
+ def title(self):
+ return self.context.title or getName(self.context)
+
def breadcrumbs(self):
if not self.globalOptions('showBreadcrumbs'):
return []
@@ -100,6 +104,13 @@ class NodeView(BaseView):
if menuItem != menu.context:
data.append(dict(label=menuItem.title,
url=absoluteURL(menuItem, self.request)))
+ for p in getParents(menuItem):
+ if p == menu.context:
+ break
+ data.insert(1, dict(label=p.title,
+ url=absoluteURL(p, self.request)))
+ if self.virtualTarget:
+ data.extend(self.virtualTarget.breadcrumbs())
return data
def recordAccess(self, viewName=''):
diff --git a/browser/skin/lobo/body.pt b/browser/skin/lobo/body.pt
index 6f8f83c..fc9fc50 100644
--- a/browser/skin/lobo/body.pt
+++ b/browser/skin/lobo/body.pt
@@ -29,10 +29,11 @@