[Zope] DTMLFile question -- half solution

Max M maxm@mxm.dk
Thu, 15 Aug 2002 14:34:25 +0200


tomas@fabula.de wrote:

>It works -- in a way. The thing finds the right file in the directory
>given, transforms it into a DTML method and this gets called alright.
>That is, invoking res.component("foo") will render the DTML in file
>`dtml/CMSResource/components/foo.dtml' -- but the name space is gone:
>that's to say the dtml code within this file doesn't `see' the things
>I'd expect it to (e.g. CMSResource's methods and that).
>

You can passe the dtml class the namespace:

res.component("foo") # this returns you a class which you then can call.

res.component("foo")(self, self.REQUEST)

That should probably work.

>Comments? Ideas? Is there a better way to achieve this? Am I totally
>crazy?
>  
>

Hmmm!

regards Max M

    "klaatu verata niktu"