[Zope] Why it doesn't work?
Martin Kuhn
zope@klick-o-matic.de
Wed, 31 May 2000 12:56:03 +0200
> i can't understand why this simple method is not working:
>
> <dtml-var standard_html_header>
> ID of this page:<dtml-var id><BR>
> <dtml-with QUERY_STRING>
> New ID is:<dtml-var id><br>
> </dtml-with>
> <dtml-var standard_html_footer>
>
> If i call this page with a query string "?variable"
> i expect to see the id of the object called... but
> it's not working!
It works very well if you change your dtml-with-line into
<dtml-with "_[QUERY_STRING]">
or
<dtml-with "_.getitem(QUERY_STRING)">
(I don't know the difference between both statements.)
That means something like "give me the object with the
name i've put into the variable QUERY_STRING". You can
also use a shorter version which combines everything in
one single python expression:
<dtml-var "_.getitem(QUERY_STRING).id">
But be careful. There will be an error message if the
QUERY_STRING is empty.
martin.