From a5c44e979c24edb8ccbf14b5d087075779363310 Mon Sep 17 00:00:00 2001 From: helmutm Date: Fri, 20 Mar 2009 14:15:36 +0000 Subject: [PATCH] provide basic breadcrumbs implementation git-svn-id: svn://svn.cy55.de/Zope3/src/loops/trunk@3284 fd906abe-77d9-0310-91a1-e0d9ade77398 --- layout/base.py | 8 ++++---- layout/browser/base.py | 3 +++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/layout/base.py b/layout/base.py index ac1ae97..966dd37 100644 --- a/layout/base.py +++ b/layout/base.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2008 Helmut Merz helmutm@cy55.de +# Copyright (c) 2009 Helmut Merz helmutm@cy55.de # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -87,13 +87,13 @@ class TargetLayoutInstance(NodeLayoutInstance): """ Return sublayout instances specified by the target object. """ target = self.target - pageName = self.viewAnnotations.get('pageName', u'') if region is None or target is None: return [] - result = [] + #result = [] + result = super(TargetLayoutInstance, self).getLayouts(region) names = region.layouts.keys() - #tp = target.context.conceptType tp = target.context.getType() + pageName = self.viewAnnotations.get('pageName', u'') for n in tp.getClients(): if n.nodeType == 'info' and n.viewName in names: if pageName != n.pageName: diff --git a/layout/browser/base.py b/layout/browser/base.py index ce2ed3c..7ef7df8 100644 --- a/layout/browser/base.py +++ b/layout/browser/base.py @@ -62,6 +62,9 @@ class BaseView(object): return '%s/.%s-%s' % (absoluteURL(self.menu, self.request), self.context.uid, normalize(self.context.title)) + def breadcrumbs(self): + return [dict(label=self.title, url=self.url)] + @Lazy def authenticated(self): return not IUnauthenticatedPrincipal.providedBy(self.request.principal)