[Zope] syntax problem

Evan Simpson evan@tokenexchange.com
Tue, 31 Aug 1999 11:36:12 -0500


Here's a whirlwind tour of object access:

Suppose you have a variable 'halfabee' containing the string 'eric'.  Then
all of the following will render the Method 'eric':

<dtml-var eric> (or <dtml-var name=eric>
<dtml-var "eric(this(), REQUEST)"> (or <dtml-var expr="eric(this(),
REQUEST)">)
<dtml-var "_['eric']">
<dtml-var "_[halfabee]">

Now, if to get to 'eric' you need to go through 'sketch' and 'singing'
first, you could surround any of the above like so:

<dtml-with sketch><dtml-with singing><dtml-var
"_[halfabee]"></dtml-with></dtml-with>
<dtml-with "sketch.singing"><dtml-var "_[halfabee]"></dtml-with>

or just write:

<dtml-var "_.getattr(sketch.singing, halfabee)(this(), REQUEST)">


----- Original Message -----
From: Heiko Stoermer <heiko@mig.net>
> I have several DTML-Methods that simply hold page Fragments.
> In my main DTML Document I want to include one of these Methods via the
> <dtml-var> tag.
> If I use the method's name it works, the HTML source is included in the
> document and displayed correctly. But unfortunately, the method's id is
> stored in a variable (pagename).