[Zope-CMF] Dispatching to a skin page template

alan runyan alan runyan" <runyaga@runyaga.com
Fri, 5 Jul 2002 16:12:40 -0500


Geoff,

there are a few ways of doing this.  but they are all the same concept.
rendering a PageTemplate object in the context(here) of a Object.

the most obvious is to get a reference to the PageTemplate from the ZODB and
then call it with the options.
o=getattr(context,'PageTemplateId')
return o(parameters) #I forgot the incantation, use the src

or you can traverse to the PageTemplate in the context of a object
obj=getattr(context, 'someObjectId')
obj.restrictedTraverse('PageTemplateId')

~runyaga
p.s. Please refrain from posting HTML to the mailing list.  Its considered
poor etiquette.




----- Original Message -----
From: Geoff Davis
To: zope-cmf@zope.org
Sent: Friday, July 05, 2002 4:03 PM
Subject: [Zope-CMF] Dispatching to a skin page template


I'm trying to create a python method which, when finished, passes some
options to a page template.  Before using the CMF, I would use
PageTemplates.PageTemplateFile at initialization to get a reference to a
PageTemplate object that I could call as needed.  Now with the CMF, I need
to be able to grab the approprate page template from the current skin and do
the appropriate dispatch.  How do I get the appropriate skin's page?  (Note
that I don't want to relocate to the page, since I want to pass in options)

Thanks!

Geoff



Geoff Davis
http://www.geoffdavis.net