[Zope] Rendering DTML in my own Product

Sven Rudolph rudolph@medical-tribune.de
Wed, 2 Jan 2002 15:35:29 +0100


Hello!

I wrote a product to publish news. It has its own management screen for editing the content (headline, text, picture, source and release date). Because my product (class) inherits from "Folder" I had to overwrite "index_html":

index_html=DTMLFile('dtml/index_html',globals())

"index_html" contains:

<b><dtml-var headline></b><br>
<dtml-var picture><br>
<dtml-var text><br>
<i><dtml-var releasedate> - <dtml-var source></i>

All this works very well.

Now the part that doesn't work :-(

If I write something like <dtml-var foo> in my "text", the <dtml-var foo> isn't resolved. So I had a look at DTMLDocument.py and found a method called "__call__()" that does the rendering of the DTML code.
That was exactly what I was looking for, so now my class also inherits from "DTMLDocument". Unfortunately "__call__()" requires the attribute "data".
I tried the following as a test (after commenting out the DTMLFile line):

data=text

def index_html(self,REQUEST):
    """ """
    return self.__call__(self,REQUEST)

I thought the result would be the rendered content of "text" with <dtml-var foo> resolved, but the result was an attribute error for "raw", and I can't find anything about "raw".

I think now it's time to ask for some help.



Thanks in advance

Sven




-- 
Sven Rudolph
GermanMedicalServices.de GmbH
Unter den Eichen 5, 65195 Wiesbaden
Tel.: 06 11 / 97 46 25 2