[Zope] DTML Doc property from DTML Method in tag

Martijn Faassen M.Faassen@vet.uu.nl
Mon, 15 Feb 1999 10:53:48 +0100


Kevin Dangoor wrote:
> 
>         I'm having trouble getting at an DTML Document property
> from within an in tag in a DTML Method. I have a folder property
> that lists the documents I want to appear in a particular order.
> I would like to display the "title" and "summary" of those documents.
> 
> <!--#in docs-->
> <p><!--#var ???--></p>
> <!--#/in-->
> 
> So, if the docs list contained an entry "test", what would I put in
> the var tag to get test.title? If I use "test.title", I get the
> title. If I try "sequence-item+'.title'" or "_[sequence-item+'.title']",
> I get a NameError. What simple little thing am I missing here?

I may be wrong here as this involved a subobject of an object, however,
I suggest you try simply:

<!--#in docs-->
<p><!-- #var title--></p>
<!--#/in-->

The namespace inside #in changes to that of sequence-item. This is
documented in the Zope DTML User's guide (page 11, name lookup, I
suspect), but (hint) an "idiot's guide to DTML name lookup" would be
useful. I myself found out about this through experimentation. :)

Regards,

Martijn