[Zope] TALES and Acquisition

Dan Fairs daniel.fairs@spiderplant.net
15 Dec 2002 19:45:19 +0000


Hi,

I've just had a quick flick through the archives but can't find the
answer to my question.

I'm a newbie to TAL and TALES, though I've dabbled in Zope before. Now
I'm starting to play with page templates, as they seem more elegant than
DTML. However, I have one question. Is it possible for TALES expressions
to make use of acquisition? 

As a trivial example, say I have a script called getRoot in the root
folder that returns the URL of where that script lives. Say also I have
a folder off the root called MyFolder, which contains the following
link:

<a href="Link"
         tal:attributes="href container/getRoot">My Link Somewhere</a>

Now, I would intuitively have expected Zope to look in the container for
getRoot (ie. MyFolder), fail to find it, and look in the parent folder,
then execute it there. However - this doesn't happen. And I can't find
any mention of acquisition in the TAL docs. How do the two interoperate?
Pointers to relevant comments/docs are appreciated?

Many thanks,
Dan