[Zope] syntax problem

Martijn Pieters mj@antraciet.nl
Tue, 31 Aug 1999 16:45:32 +0200


At 16:09 31/08/99 , Heiko Stoermer wrote:
>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).
>if I put
><dtml-var pagename> or
><dtml-var "pagename">
>only the the method's id is displayed, not the contents/results of the
>method call.
>I've tried all combinations that came to my mind, but none worked.
>
>How can I solve this?

You should use inderection:

<dtml-var "_[pagename"]> will include the literal content of the object 
named by the pagename variable, and quote any HTML in it.

If yo uwant it to be called, (like the <DTML-var objectname> or <dtml-var 
name=objectname> syntax does), use this:

    <dtml-var "_.getitem(pagename, 1)">

See the DTML Users Guide, and look at the 'name' and 'expr' attributes, and 
the _ object.

--
Martijn Pieters, Web Developer
| Antraciet http://www.antraciet.nl
| Tel: +31-35-7502100 Fax: +31-35-7502111
| mailto:mj@antraciet.nl http://www.antraciet.nl/~mj
| PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149
------------------------------------------