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''
|
||||
category = 'default'
|
||||
renderer = None
|
||||
instanceName = ''
|
||||
order = 50
|
||||
sublayouts = None
|
||||
|
||||
|
@ -93,7 +94,8 @@ class LayoutInstance(object):
|
|||
sublayouts = self.template.sublayouts
|
||||
for l in region.layouts:
|
||||
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
|
||||
result.append(li)
|
||||
return result
|
||||
|
|
|
@ -73,7 +73,8 @@ class Page(BaseView):
|
|||
if n in layoutNames:
|
||||
layout = layouts[n]
|
||||
break
|
||||
instance = ILayoutInstance(self.context)
|
||||
instance = component.getAdapter(self.context, ILayoutInstance,
|
||||
name=layout.instanceName)
|
||||
instance.template = layout
|
||||
view = LayoutView(instance, self.request, name='page',
|
||||
parent=self, page=self)
|
||||
|
|
Loading…
Add table
Reference in a new issue