[Zope] another tal questions

J. Cameron Cooper jccooper at jcameroncooper.com
Mon Dec 1 19:21:57 EST 2003


Kate Legere wrote:

>Is there a TAL equivalent for this DHTML statement:
>  <dtml-var sequence-item html_quote newline_to_br> 
>
>I used the python statement:
>context.manage_addProduct['OFSP'].manage_addFile(id,
>                                         title="", file="description")
>
>to add the file and I want now, within my TAL to read the 'description' 
>I tried :
>
> <b tal:content="item/description"> news </b>  
>  
>
The DTML transform methods are available in the 
Products.PythonScripts.standard package. You can do::

  <b tal:define="pss python:Products.PythonScripts.standard" tal:content="python: pss.newline_to_br(item.description)"> news </b>

The default operation of taL:content does an HTML quote, but you can nest such calls if you like. Of course, you can expand the 'pss' and forget the 'define' or define the shortcut to the library higher up.

	--jcc

-- 
"My point and period will be throughly wrought,
Or well or ill, as this day's battle's fought."





More information about the Zope mailing list