[ZPT] Truncating strings

Tino Wildenhain tino at wildenhain.de
Tue Oct 21 19:01:12 EDT 2003


Hi Eron,

Eron Lloyd wrote:
> Hello,
> 
> Does anyone know of a simple way to truncate string insertions in a ZPT? What 
> I'm looking for is basically a replacement for dtml-var's "size" and "etc" 
> attributes. I would do it on the MySQL side but that doesn't seem to have 
> such a function, either.
> 
While I think you are probably able to import such formating functions
from DTMLMethod and co., you could at least use a python script to
format to your needs.
Since you can run your output of the ZSQL methods thru a python script
anyway (for default arguments, basic request caching and other
modifications on the resultset) you can do the string modification
as well.

Regards
Tino Wildenhain




More information about the ZPT mailing list