[Zope] DTML Doc property from DTML Method in tag

Kevin Dangoor kid@ans.net
Mon, 15 Feb 1999 10:49:59 -0500


On Mon, Feb 15, 1999 at 10:53:48AM +0100, Martijn Faassen wrote: 
,-----
| 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. :)

I think this would work if docs was a group of actual objects. However,
docs is a "lines" Folder property. So, the sequence-item is just a string.
If I say:
<!--#var "sequence-item + '.title'"-->, it will say "test.title".
However, I can seem to get it to actually track down test.title
as if I had done:
<!--#var test.title-->

(BTW, I tried the example you gave and it prints the Folder's title.)

Kevin

| 
| Regards,
| 
| Martijn
| 
| _______________________________________________
| Zope maillist  -  Zope@zope.org
| http://www.zope.org/mailman/listinfo/zope
`-----

-- 
Kevin Dangoor
UUnet Technologies
kid@ans.net / 734-214-7349