[Zope] <dtml-with> namespace conflict question needs explanation

Casey Duncan casey.duncan@state.co.us
Mon, 14 Aug 2000 12:08:36 -0600


Jason Cunliffe Wrote:
> Hello
>
> Please can someone help us understand how to avoid DTML method names
> conflicting with other zope objects with same name.
...
> 2. Below this my DTML file includes calls to this template like this:

> <dtml-with Flash4>
> <dtml-call "REQUEST.set('swf','login.swf')">
> <dtml-call "REQUEST.set('width','100%')">
> <dtml-call "REQUEST.set('height','100%')">
> <dtml-var objembedswf>
> </dtml-with>
...
> It provokes me to ask simply what is the search path priority of object
> acquistion in zope and how do you control it safely?

This appears to be a classic aquisition gotcha. You can use the "only"
option of the
dtml-with tag to eliminate namespace conflicts. However, in this case I
might suggest passing the parameters directly to objemedswf instead of using
REQUEST. like so:

<dtml-var "Flash4.objembedswf(swf='login.swf', width='100%',
height='100%')">

This leaves no ambiguity about what is being called, where it is located and
what is being passed to it. This creates more readable code IMHO.

-Casey Duncan