Commit 3e8e6cee authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

custom render method should be called on default document if exists.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@28858 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a4569da2
...@@ -174,10 +174,7 @@ class WebSection(Domain, PermanentURLMixIn): ...@@ -174,10 +174,7 @@ class WebSection(Domain, PermanentURLMixIn):
self.REQUEST[self.web_section_key] = self.getPhysicalPath() self.REQUEST[self.web_section_key] = self.getPhysicalPath()
self.REQUEST.set('current_web_section', self) self.REQUEST.set('current_web_section', self)
if not self.REQUEST.get('editable_mode') and not self.REQUEST.get('ignore_layout'): if not self.REQUEST.get('editable_mode') and not self.REQUEST.get('ignore_layout'):
# Try to use a custom renderer if any document = None
custom_render_method_id = self.getCustomRenderMethodId()
if custom_render_method_id is not None:
return getattr(self, custom_render_method_id)()
if self.isDefaultPageDisplayed(): if self.isDefaultPageDisplayed():
# The following could be moved to a typed based method for more flexibility # The following could be moved to a typed based method for more flexibility
document = self.getDefaultDocumentValue() document = self.getDefaultDocumentValue()
...@@ -200,8 +197,15 @@ class WebSection(Domain, PermanentURLMixIn): ...@@ -200,8 +197,15 @@ class WebSection(Domain, PermanentURLMixIn):
id=document.getReference(), id=document.getReference(),
original_container=document.getParentValue(), original_container=document.getParentValue(),
original_id=document.getId(), original_id=document.getId(),
editable_absolute_url=document.absolute_url())) editable_absolute_url=document.absolute_url())).__of__(self)
return document.__of__(self)() # Try to use a custom renderer if any
custom_render_method_id = self.getCustomRenderMethodId()
if custom_render_method_id is not None:
if document is None:
document = self
return getattr(document, custom_render_method_id)()
elif document is not None:
return document()
return Domain.__call__(self) return Domain.__call__(self)
# Layout Selection API # Layout Selection API
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment