[Zope] Document parameters as part of a URL

Chris Withers chris at simplistix.co.uk
Thu Jun 8 02:41:50 EDT 2006


Peter Bengtsson wrote:
> Well, you could maybe create a new type of DTML Method called Clear
> DTML Method which would in principle look something like this:
> 
> from zope.somewhere import DTMLMethod
> class ClearDTMLMethod(DTMLMethod):
>    meta_type = "Clear " + DTMLMethod.meta_type
>    def __before_publishing_traverse__(...):
>            do your stuff
> # cross your fingers that it will work
> 
> But this restricts you to DTML Methods. So if you change to Page
> Templates one day you'll have to recode the url param stuff.

Actually both ZPT and Python Scripts support this kind of thing 
automatically with the traverse_subpath variable. Anything after the 
name of the ZPT or PS in the URL gets put as a tuple in that variable.

Yet another reason to ditch your suzzy DTM(hel)L ;-)

Chris

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



More information about the Zope mailing list