[Zope] "evaluating" a REQUEST Parameter to be passed to a dtml-var

Danny William Adair danny@adair.net
Wed, 17 Oct 2001 10:23:13 +1300


Hi Jean-Francois!

There is more than one approach.
If you have the id of your object as a string in the REQUEST variable 
"document", try

<dtml-let document_object="_[document]">
<dtml-var document_object fmt=structured-text>
</dtml-let>

or, this is more precise:

<dtml-let document_object="_[REQUEST['document']]">
<dtml-var document_object fmt=structured-text>
</dtml-let>

for a start. Sorry for the briefness of this reply

hth,
Danny

On Wednesday 17 October 2001 09:34, Doyon, Jean-Francois wrote:
> Hello,
>
> Sorry, but I'm new at this :)
>
> The problem is simple, I want to call a dtml-var using a name (object)
> provided by the URL
>
> So for instance if the url is:
>
> http://host/cmf?document=main_english
>
> I want <dtml-var main_english fmt="structured-text"> to work properly.
>
> Of course the problem I'm having right now is that the parameter value is
> being passed as a string instead of being eval'ed ... So instead of the
> contents of "main_english" I get the STRING "main_english"!
>
> Unfortunately (Although for good reason) python's "eval" is not available
> ...
>
> So how do I do it?
>
> Thanks!
>
> Jean-François Doyon
> Internet Service Development and Systems Support
> GeoAccess Division
> Canadian Center for Remote Sensing
> Natural Resources Canada
> http://atlas.gc.ca
> Phone: (613) 992-4902
> Fax: (613) 947-2410
>
>
> _______________________________________________
> 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 )