allow setting of main template via controller (which is found via skin)
This commit is contained in:
parent
fcb29171ad
commit
14cfdb7624
2 changed files with 6 additions and 4 deletions
|
@ -1,5 +1,5 @@
|
||||||
#
|
#
|
||||||
# Copyright (c) 2011 Helmut Merz helmutm@cy55.de
|
# Copyright (c) 2016 Helmut Merz helmutm@cy55.de
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
@ -18,8 +18,6 @@
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Controller for views, templates, macros.
|
Controller for views, templates, macros.
|
||||||
|
|
||||||
$Id$
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from zope import component
|
from zope import component
|
||||||
|
@ -77,6 +75,10 @@ class Controller(object):
|
||||||
IMemberInfoProvider)
|
IMemberInfoProvider)
|
||||||
return provider is not None and provider.data or None
|
return provider is not None and provider.data or None
|
||||||
|
|
||||||
|
def setMainPage(self):
|
||||||
|
# May be overridden by subclasse for setting special main index template
|
||||||
|
pass
|
||||||
|
|
||||||
def getTemplateMacros(self, name, default):
|
def getTemplateMacros(self, name, default):
|
||||||
template = self.templates.get(name)
|
template = self.templates.get(name)
|
||||||
if template is None:
|
if template is None:
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<metal:block define-macro="page"
|
<metal:block define-macro="page"
|
||||||
tal:define="controller nocall:view/@@controller;
|
tal:define="controller nocall:view/controller;
|
||||||
dummy view/setupSubviews"
|
dummy view/setupSubviews"
|
||||||
tal:condition="view/update"><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
tal:condition="view/update"><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml"
|
<html xmlns="http://www.w3.org/1999/xhtml"
|
||||||
|
|
Loading…
Add table
Reference in a new issue