[Zope] Truncating strings with DTML

Chris Withers chris at simplistix.co.uk
Tue Sep 6 03:07:52 EDT 2005


Peter Bengtsson wrote:
> easy:
> <dtml-let strDirPath="'/'.join(strDirPath.split('/')[:-1])">
> You don't need to use _.string.legacy() functions. Just put your
> python expression inside the quotation marks. If you're new to python,
> don't let DTML be your place to learn python. Use a nice editor like
> IDLE.

Just to emphasise what Peter is saying: do this in ZPT and put the logic 
in a python script. You'll suffer a lot less in the long run as a result ;-)

cheers,

Chris

-- 
Simplistix - Content Management, Zope & Python Consulting
            - http://www.simplistix.co.uk



More information about the Zope mailing list