[Zope] DTML namespace lookups

Matt Gregory matthew.gregory@skyleach.com
Wed, 10 Apr 2002 14:03:30 -0400


Gosh darnit I love the way the human mind works.  Solved my own problem
again.

In a call the DTMLDocument method __call__ the client parameter is implicity
(defaults to) none, instead of what is *should* be: itself.  So the
namespace contained no client, and thus nothing to look up.  In order for
the call to properly execute I had to change that line of dtml from:
<dtml-var "leftnav['patientleftnav']()">
to:
<dtml-var "leftnav['patientleftnav'](leftnav['patientleftnav'])">
In my honest opinion this function should be changed to work so that if
client=None then client=_.

----- Original Message -----
From: "Matt Gregory" <matthew.gregory@skyleach.com>
To: "Zope" <zope@zope.org>
Sent: Wednesday, April 10, 2002 1:48 PM
Subject: [Zope] DTML namespace lookups


> In the following namespace:
>
> psn
>   |_images
>   |_portals
>        |_PatientPortal
>              |_portlets
>                  |_portlet_template
>                  |_leftnav
>                         |_images
>                             |_Ahmonson
>
> I have a dtml method in "leftnav" called "patientleftnav" which looks
like:
>
> <dtml-var portal_framework_footer>
> <dtml-if groupname>
>   <dtml-let imageDirectory="images[groupname]"
>           dotpic="psn['portals']['dot_img']">
>     <dtml-var patientleftnav_content>
>   </dtml-let>
> <dtml-else>
> <dtml-let groupname="'Ahmanson'">
>   <dtml-let imageDirectory="images[groupname]"
>           dotpic="psn['portals']['dot_img']">
>     <dtml-var patientleftnav_content>
>   </dtml-let>
> </dtml-let>
> </dtml-if>
>
> That method works fine, unless I call it from a method in "portlets"
called
> "portlet_template" which looks like:
>
> <dtml-var portal_framework_header>
>
> <dtml-var "leftnav['patientleftnav']()">
> <dtml-with REQUEST>
>   <dtml-if includeFile>
>       <dtml-var "_[includeDir][includeFile]()">
>   <dtml-else>
>     No include file.
>   </dtml-if>
> </dtml-with>
>
> The error I get:
> Error Type: NameError
> Error Value: global name 'images' is not defined
>
> I'm guessing that the line: <dtml-var "leftnav['patientleftnav']()"> is
> somehow not properly being executed in the proper namesapce, but I'm
really
> not understanding why, or how to fix this problem.
>
>
>
> _______________________________________________
> 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 )
>