[Zope] Using DTMLFile or PageTemplateFile in methods

Evan Simpson evan@4-am.com
Thu, 19 Jul 2001 11:19:40 -0400


Peter Bengtsson wrote:

>       def which_index_html(self):
>              return PageTemplateFile('index', globals())
> 
>       index_html = which_index_html
> 
> That does NOT work! It looks like a small change, but I might be wrong.
> How to do this anyone?


Well, it would probably work if you wrote:

 > index_html = which_index_html()

...but I get the idea that that's not what you want.

> In my product the templates used will change inside the instance, so that
> /mysite/instance1 uses one template and /mysite/instance2 uses another.

It's hard to know what you need to do without more information.

Cheers,

Evan @ digicool & 4-am