[Zope] DTML rendering from python?

Andy McKay andy@agmweb.ca
Wed, 22 Jan 2003 09:10:50 -0800


> I'm hoping a Zope guru on the list can help me with this one. I'm
> writing a python product that does some fancy processing of HTML. The
> problem is that the DTML tag I add to the output of getHTML doesn't get
> rendered in my DTML Document when I call the object. I'm probably
> overlooking the obvious, but I'm totally stuck :-S

 > viewArticlePage.dtml does a <dtml-var getHTML> to publish the object.

DTML renders the code once and once only processing getHTML. What you 
really want to do is

	html += "<p>%s</p>" % self.getId()

Mixing HTML and Python is bad, you should be putting any HTML in your 
DTML or ZPT and making calls to your python object to get bits and 
peices or do things...
-- 
   Andy McKay