Can't get dtml-in to work!
Hi, this must be a very dumb question, but I can't find the mistake. Anyone seeing why the the following DTML does not work? It does not print anything besides 'Hello', though I created several folders in the one where the document below resides. Choosing different meta types doesn't help either... <dtml-var standard_html_header> <h2><dtml-var title_or_id></h2> <p> Hello <dtml-in expr="objectValues('Folder')"> Out there ! <dtml-var sequence-length> <dtml-var getId> </dtml-in> </p> <dtml-var standard_html_footer> Anyone knows help? Regards, Lars
Try <dtml-in expr="PARENTS[0].objectValues('Folder')"> Out there ! <dtml-var sequence-length> <dtml-var getId> </dtml-in> Your method is trying to iterate through any objects contained within the document - you need to go one up the aquisition tree before going through objects hth Laurie -----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of lvw@lfpt.rwth-aachen.de Sent: Thursday, July 12, 2001 12:40 PM To: zope@zope.org Subject: [Zope] Can't get dtml-in to work! Hi, this must be a very dumb question, but I can't find the mistake. Anyone seeing why the the following DTML does not work? It does not print anything besides 'Hello', though I created several folders in the one where the document below resides. Choosing different meta types doesn't help either... <dtml-var standard_html_header> <h2><dtml-var title_or_id></h2> <p> Hello <dtml-in expr="objectValues('Folder')"> Out there ! <dtml-var sequence-length> <dtml-var getId> </dtml-in> </p> <dtml-var standard_html_footer> Anyone knows help? Regards, Lars _______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
--- this must be a very dumb question, but I can't find the mistake. Anyone seeing why the the following DTML does not work? It does not print anything besides 'Hello', though I created several folders in the one where the document below resides. Choosing different meta types doesn't help either... --- <dtml-in expr="objectValues(['Folder'])"> Out there ! <dtml-var sequence-length> <dtml-var getId> </dtml-in> should be more like <dtml-in expr="objectValues(['Folder'])"> notice the extra "[]" around it and you don't have to play with parent afaik (cf laurie) to get it to work. $ven
Lars, FWIW, I pasted your code into a DTML method in my Zope root and it worked for me. -Eric
<dtml-var standard_html_header> <h2><dtml-var title_or_id></h2> <p> Hello <dtml-in expr="objectValues('Folder')"> Out there ! <dtml-var sequence-length> <dtml-var getId>
</dtml-in> </p> <dtml-var standard_html_footer>
OK - I pasted into a Document and obviously got bitten by aquisition (again!) If it's in a document then it won't work - but because a Method takes on the namespace around it (techically incorrect jargon - I know!) it then looks in the folder it is in. Laurie -----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Eric Walstad Sent: Thursday, July 12, 2001 1:04 PM To: zope@zope.org; lvw@lfpt.rwth-aachen.de Subject: RE: [Zope] Can't get dtml-in to work! Lars, FWIW, I pasted your code into a DTML method in my Zope root and it worked for me. -Eric
<dtml-var standard_html_header> <h2><dtml-var title_or_id></h2> <p> Hello <dtml-in expr="objectValues('Folder')"> Out there ! <dtml-var sequence-length> <dtml-var getId>
</dtml-in> </p> <dtml-var standard_html_footer>
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
participants (4)
-
Eric Walstad -
Laurie Nason -
lvw@lfpt.rwth-aachen.de -
Sven Fischer