[Zope3-Users] Rendering subobjects in pages

Greg Baker gbaker at cs.mun.ca
Mon Aug 6 08:21:18 EDT 2007


How can I specify a template to render a sub-object within one of my content 
objects?

For example, pretend I have a Contact object which contains a Person object.  
I am rendering the Contact object through a page template.

class Contact:
    person = Person()

In all the examples I see, rendering the person would be done using many tal 
expressions like <span tal:content="context/person/name" /> or something 
similar.

Is it possible to render the person object using a single tal expression, <div 
tal:content="context/person" />, having the rendering handled by a template 
somewhere?  The reason I want to do this is because the person object will be 
used in many different classes and for a consistent look and feel I would 
like to render the object the same on all pages without having to maintain 10 
different page templates.

Hope this makes sense.
Greg


More information about the Zope3-users mailing list