[Zope] How to render a HTMLFile in a method in a product

Max Møller Rasmussen maxm@normik.dk
Thu, 26 Oct 2000 13:49:02 +0200


I would have thought that the two examples below where equivalent but only
the top one works like expected. (It renders the page.)

The second one just shows the source of the vanilla dtml page.

--
test = HTMLFile('vanilla', globals())

--
def test(self):
    "A simpe test method"        
    return  HTMLFile('vanilla', globals())
--

How do I execute the dtml file in a method. I have searched the
documentation, but it is sketchy to say the least.

I cannot use the first approach as I need to define the filename on the fly
in my method.

def test(self):
    "A simpe test method"        
    return  HTMLFile('skins/' + self.skin, globals())

self.skin is only available in my object, so naturally if I try to say:

test = HTMLFile('skins/' + self.skin, globals())

I get an error.

Regards
	
	Max M