[Zope] subpath in dtml?

Tino Wildenhain tino@wildenhain.de
Sat, 23 Nov 2002 12:17:52 +0100


Hi Jonatan,

just use the traverse_subpath in your Python script as you need
to. Thats pretty fine.
Then output your HTML using a template. If its a page template
you simply call

return context.yourOutputTemplate(context)

or if you want to pass parameters, call is like so:

return context.yourOutputTemplate({'foo':1,'bar':5})

so you can find foo and bar in the options namespace.

DTML call is similar and scould be mentioned in the list archive
several times.

Making nice URLs using traverse_subpath is a good thing (tm) :-)

HTH
Tino Wildenhain

--On Freitag, 22. November 2002 23:01 +0100 jonatan 
<jonatanpelikan@freemail.hu> wrote

>
> hi!
>
>
> i have a very simple problem: i have a dtml method called reg which
> should finalize a registration ... so i would like to have such urls:
> http://some.site.com/reg/b6ac3fe9
>
> if reg is a dtml method, then entering this url gives me a not found
> error ... ok cool .
>
> lets do a python script, and traverse_subpath. subpath doesnt exist (but
> its binded!!) so lets use traverse_subpath ...
>
> but now i am in a python script, i dont want to output html from here, i
> just want to check a row in the database!
>
> (outputting html gives me nice &lt; stuff - this is great too!)
>
>
> i searched for traverse_subpath, and didnt find something of use. just a
> traversable dtml document product.
>
> ARGH!
>
> please! i dont want to install products or make some magic with python
> scripts interacting with dtml! i started using zope because of its
> simplicity, i dont know why isnt there a simple way of doing this??
>
> or perhaps there is but i cannot find it?
>
> i am very desperated :)
>
> all i need is a <dtml-if> checking against the part after 'reg' ..
> (b6ac3fe9 here) ... i dont want python scripts for a single if ... why
> do you zope developers think that traverse_subpath should be used in a
> pythn script only?
> how can i achieve the same in dtml?
>
> why isnt http://something/reg/foo/bar working as dtml, but is working as
> a python script?
>
>
> zope is cool, i love smoking too, but sometimes it can be so hairy ...
> damn .. :)
>
> thanks,
>
> -jonatan.
>
>
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )