[Zope] Structured Text and ZPT

Olivier Laurent oli@aragne.com
Thu, 14 Mar 2002 17:12:58 +0100


On jeu, 14 mar 2002, Tom Nixon wrote:
> > Subject: Re: [Zope] Structured Text
> 
> How do you render STX in a ZPT?

Here is how I'm doing it:

I have a Page Template defining a macro. In this macro, I call a Python
Script called 'get_content'. Here is the call to the script in the ZPT:

...
      <div tal:replace="structure python:here.get_content(here,
request)"></div>
...

Here is the Python Script. It takes 2 parameters (client, mapping):

from Products.PythonScripts.standard import structured_text

content_html = context.content_html(client, mapping)

return structured_text(context.content_html(client, mapping))

And 'content_html' is a DTML Method containing your structured text. It
can even contain DTML-tags if you want.

If it's not what you wanted to do, check the ZPT Mailing List archive from
Septmber 2001. I think there is a message about that.

-- 
Olivier Laurent.
P3B    : Club Python(-Zope) Belge --------- http://www.p3b.org
OS3B   : Club Open-Software(-Linux) Carolo  http://www.os3b.org 
Aragne : Python-Zope Solutions & Formations http://www.aragne.com