[Zope] DTML Newbie: Using variable as an object in path?

Patrick Price patrick@wvu.edu
Thu, 09 Jan 2003 11:22:05 -0500


I'm lost. I have a folder, channels, and inside that, an RDF Summary 
object named slashdot:

<dtml-let channel="slashdot">
<dtml-with "channels[channel]">
   etc...
</dtml-with>
</dtml-let>

This results in "Global name 'slashdot' is not defined."  

An interesting aside:  if I try <dtml-with "channels.[channel]"> the 
source will refuse to save, I get "page not found" when I click Save 
Changes.

What am I doing wrong?
-Patrick Price

Kevin Carlson wrote:

>You could accomplish the first by using:
>
>  <dtml-with "a_folder_name[the_variable_name]">
>    --Note it says "the_variable_name" and not "the_variable_value"
>
>Another way to set a variable within the current DTML is to use <dtml-let>.
>
>Hope that helps,
>
>Kevin
>
>-----Original Message-----
>From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of
>Patrick Price
>Sent: Wednesday, January 08, 2003 11:52 PM
>To: zope@zope.org
>Subject: [Zope] DTML Newbie: Using variable as an object in path?
>
>
>I'd like to set a variable in a DTML document, then call another DTML 
>doc and use that variable as part of an object path:, eg:
>
><dtml-with  a_folder_name.the_variable_value>
>
>so I can use different objects (files) by passing the filename in the 
>variable.
>
>How can I do this?
>
>Also, is the correct way to set a DTML variable to use  dtml-call 
>REQUEST.set  or is there another way?
>
>Thanks in advance,
> Patrick Price
>
>
>_______________________________________________
>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 )
>