use option on document type for showing text title in section
This commit is contained in:
parent
f5accbb205
commit
cdfd5824e1
3 changed files with 8 additions and 1 deletions
|
@ -129,6 +129,10 @@ class Base(object):
|
|||
if dt is not None:
|
||||
return IOptions(adapted(dt))(name)
|
||||
|
||||
def getTitleForResource(self, r):
|
||||
if self.getOptionsForResource(r, 'showtitle'):
|
||||
return r.title
|
||||
|
||||
def getIconForResource(self, r):
|
||||
icon = self.getOptionsForResource(r, 'icon')
|
||||
if icon:
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
type(u'documenttype', u'Dokumentenart', options=u'qualifier:assign',
|
||||
typeInterface='loops.interfaces.IOptions',
|
||||
typeInterface=u'loops.interfaces.IOptions',
|
||||
viewName=u'')
|
||||
|
||||
# book types
|
||||
|
|
|
@ -45,6 +45,9 @@
|
|||
<div metal:define-macro="default_text"
|
||||
tal:attributes="class python:
|
||||
item.getCssClassForResource(related)">
|
||||
<h3 tal:define="ttitle python:item.getTitleForResource(related)"
|
||||
tal:condition="ttitle"
|
||||
tal:content="ttitle" />
|
||||
<img class="flow-left" style="padding-top: 5px"
|
||||
tal:define="icon python:item.getIconForResource(related)"
|
||||
tal:condition="icon"
|
||||
|
|
Loading…
Add table
Reference in a new issue