[Zope] dtml-with help

Toby Dickenson tdickenson@geminidataloggers.com
Fri, 24 May 2002 17:35:30 +0100


On Friday 24 May 2002 5:44 pm, Matt Standish wrote:
>Hello-
>I have a simple question.
>I would like to do this:
><dtml-with <dtml-var group>>
>But of course it does not work. <dtml-var group> Is a value in my MySql
>database.  It also represents a directory name in my Zope tree.  Meaning
>is the user is in the engineering group they will be forced into the
>engineering directory.  Did that make any sense?

So you want to search the dtml namespace for something with the name 'group'. 
Then, search the dtml namespace for something whose name is the same as the 
value you found in the first search ?

That would be:

<dtml-with "_[group]">

Searching the whole dtml namespace for that directory may not be the best 
idea. What happens if something earlier in the search order has the same 
name? for example, it is unlikely you would find the right directory if 
'group' contained the string 'title'.

I suggest you write a short python script which checks only in the places you 
expect to find these directories.


I hope this helps,