[Zope] Calling ZClass DTML methods with arguments.

Chris Walter walter@budoe.bu.edu
Tue, 3 Aug 1999 20:30:31 -0400 (EDT)


Dear Zopesters,

First off a big thanks.  I am a high energy physicist and I was able
to put together a interactive FAQ page for our experiment when I
needed to do a good job quickly using Zope.  Everyone was quite
impressed.  

Now I am playing with Zope 2.0 and ZClasses.  There is something I
can't figure out that I was hoping someone could give me a pointer on.

Basically what I want to do is make a ZClass object for a directory of 
pictures from a photoCD where each picture has several resolutions.
So ideally in my HTML code I would like to have something like this:

<!--#var "pcd2082.link(name='naples-small',align='left')"-->

where pcd2082 is an instance of my zclass and link is a DTML method
which presents a small version of the picture as a link to a larger
version.  I can't seem to do this though.  After searching
documentation mailing lists etc I discovered I needed to do this:

<!--#var "pcd2082.link(pcd2082,REQUEST,name='naples-small',align='left')"-->

In other words I need to tell the function about its name space and
mapping.

I also know you can do this:

<!--#call "REQUEST.set('name','naples-small')"-->
<!--#with pcd2082-->
<!--#var link-->
<!--#/with-->


But the reason I am trying to this is I wan't something that looks very 
simple and straightforward and only takes one line.  I don't see why
when I call a method of pcd2082 I should need to tell it to use the
namespace of pcd2082.  Shouldn't that be the default?  In c++ lingo a
member function of a class knows all about its instance's public data.

So stated more succinctly:

Is there a way I can call a DTML method of a ZClass instance with
arguments without also passing the first two namespace arguments?

Thanks again,

-Chris Walter
walter@budoe.bu.edu