diff --git a/layout/browser/base.py b/layout/browser/base.py index a6494d2..cef66da 100644 --- a/layout/browser/base.py +++ b/layout/browser/base.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2009 Helmut Merz helmutm@cy55.de +# Copyright (c) 2013 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 @@ -18,8 +18,6 @@ """ Base classes for layout-based views. - -$Id$ """ from zope.app.security.interfaces import IUnauthenticatedPrincipal @@ -29,6 +27,7 @@ from zope.proxy import removeAllProxies from zope.security.proxy import removeSecurityProxy from zope.traversing.browser import absoluteURL +from cybertools.meta.interfaces import IOptions from cybertools.util import format from loops.common import adapted from loops.i18n.browser import LanguageInfo @@ -170,3 +169,7 @@ class BaseView(object): def getMetaDescription(self): return self.context.title + @Lazy + def globalOptions(self): + return IOptions(self.loopsRoot) + diff --git a/layout/browser/node.py b/layout/browser/node.py index e2a7167..46435b1 100644 --- a/layout/browser/node.py +++ b/layout/browser/node.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2008 Helmut Merz helmutm@cy55.de +# Copyright (c) 2013 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 @@ -18,8 +18,6 @@ """ Layout node views. - -$Id$ """ from zope.app.security.interfaces import IUnauthenticatedPrincipal @@ -66,6 +64,9 @@ class LayoutNodeView(Page, BaseView): if self.target is not None: targetView = component.getMultiAdapter((self.target, self.request), name='layout') - return ' - '.join((self.context.title, targetView.title)) + parts = [self.context.title, targetView.title] else: - return self.context.title + parts = [self.context.title] + if self.globalOptions('reverseHeadTitle'): + parts.reverse() + return ' - '.join(parts)