Hi, I would like to pull data from a database - text with paragraphs. I then want to format that as structured text, inserting the result into a page template. The question I guess is - can I use the structured text fromatin code to format the database text before inserting into the ZPT? TIA Dave Kyte
on or about, Thursday, May 16, 2002, we have reason to believe that David Kyte wrote something along the lines of : DK> I would like to pull data from a database - text with paragraphs. DK> I then want to format that as structured text, inserting the DK> result into a page template. DK> The question I guess is - can I use the structured text fromatin DK> code to format the database text before inserting into the ZPT? DK> TIA DK> Dave Kyte what i find to be the cleanest way is the following: create a pythonScript with id "stx" parameters : text ########## from Products.PythonScripts.standard import structured_text return structured_text(text) ########## then you can simply do the following in your pageTemplate: <p tal:replace="python:here.stx(YourStringToBeFormattedAsStructuredText)"/> hth :) -- Geir Bækholt web-developer geirh@funcom.com funcom oslo | webdev-team
Geir Bækholt wrote:
then you can simply do the following in your pageTemplate:
<p tal:replace="python:here.stx(YourStringToBeFormattedAsStructuredText)"/>
Oops... better make that: <p tal:replace="structure python:here.stx(YourStringToBeFormattedAsStructuredText)"></p> Cheers, Evan @ 4-am
participants (3)
-
David Kyte -
Evan Simpson -
Geir B�kholt