use 'instanceName' attribute for controlling layout instances
git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@2993 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
parent
d4ef8e54c1
commit
6955e73e84
2 changed files with 5 additions and 2 deletions
|
@ -61,6 +61,7 @@ class Layout(Template):
|
||||||
title = description = u''
|
title = description = u''
|
||||||
category = 'default'
|
category = 'default'
|
||||||
renderer = None
|
renderer = None
|
||||||
|
instanceName = ''
|
||||||
order = 50
|
order = 50
|
||||||
sublayouts = None
|
sublayouts = None
|
||||||
|
|
||||||
|
@ -93,7 +94,8 @@ class LayoutInstance(object):
|
||||||
sublayouts = self.template.sublayouts
|
sublayouts = self.template.sublayouts
|
||||||
for l in region.layouts:
|
for l in region.layouts:
|
||||||
if sublayouts is None or l.name in sublayouts:
|
if sublayouts is None or l.name in sublayouts:
|
||||||
li = ILayoutInstance(self.context)
|
li = component.getAdapter(self.context, ILayoutInstance,
|
||||||
|
name=l.instanceName)
|
||||||
li.template = l
|
li.template = l
|
||||||
result.append(li)
|
result.append(li)
|
||||||
return result
|
return result
|
||||||
|
|
|
@ -73,7 +73,8 @@ class Page(BaseView):
|
||||||
if n in layoutNames:
|
if n in layoutNames:
|
||||||
layout = layouts[n]
|
layout = layouts[n]
|
||||||
break
|
break
|
||||||
instance = ILayoutInstance(self.context)
|
instance = component.getAdapter(self.context, ILayoutInstance,
|
||||||
|
name=layout.instanceName)
|
||||||
instance.template = layout
|
instance.template = layout
|
||||||
view = LayoutView(instance, self.request, name='page',
|
view = LayoutView(instance, self.request, name='page',
|
||||||
parent=self, page=self)
|
parent=self, page=self)
|
||||||
|
|
Loading…
Add table
Reference in a new issue