Hello, I've teh following line in a pagetemplate at the root of my site : <span tal:content="structure template/masters/nieuws/homenews"></span> homenews is a DTML Method with the following code : <div align="center" class="titel">Laatste Masters nieuws</div> <img src="gfx/tabel/lijn.gif" width="100%" height="2"><br> <dtml-in expr="objectValues('DTML Document')" reverse size=3 sort=id orphan=0> <dtml-if Publish> <dtml-var Date fmt="%d-%m-%Y">: <a href="masters/nieuws/<dtml-var id>/newstemplate"><dtml-var title></a><br> </dtml-if> </dtml-in> This code has to show the last 3 news items (DTML Document's). Something is going wrong with a folder or somethin like that because the DTML Method show no news items. Mayby because there are no DTML Document with the right properties in the root. How can I tel Tal or the DTML Method to look for the news items in the following folder: /masters/nieuws Who can help me ?
On Thu, 2003-11-06 at 07:53, Martin Koekenberg wrote:
This code has to show the last 3 news items (DTML Document's). Something is going wrong with a folder or somethin like that because the DTML Method show no news items. Mayby because there are no DTML Document with the right properties in the root.
Maybe so. First rule of troubleshooting is to test your assumptions. Start simply... get a list of objects and display their ids... next, restrict the type of object... once that works, restrict by properties, number returned, etc. Somewhere along the way, you'll figure out what you've done wrong. HTH, Dylan
Helly Dylan, I know what is ' going wrong.
From a Page Template in the root I linked a DTML Method in a sub folder. But this DTML Method is looking for DTML Documents in the root in stead of it's own sub folder.
Do you know a solutiuon for this ? Martin Koekenberg ----- Original Message ----- From: "Dylan Reinhardt" <zope@dylanreinhardt.com> To: "Martin Koekenberg" <zope@digital-adventures.nl> Cc: "Zope Users" <zope@zope.org> Sent: Thursday, November 06, 2003 5:31 PM Subject: Re: [Zope] TAL DTML Method & folder question
On Thu, 2003-11-06 at 07:53, Martin Koekenberg wrote:
This code has to show the last 3 news items (DTML Document's). Something is going wrong with a folder or somethin like that because the DTML Method show no news items. Mayby because there are no DTML Document with the right properties in the root.
Maybe so. First rule of troubleshooting is to test your assumptions.
Start simply... get a list of objects and display their ids... next, restrict the type of object... once that works, restrict by properties, number returned, etc. Somewhere along the way, you'll figure out what you've done wrong.
HTH,
Dylan
On Fri, 2003-11-07 at 03:13, Martin Koekenberg wrote:
I know what is ' going wrong.
From a Page Template in the root I linked a DTML Method in a sub folder. But this DTML Method is looking for DTML Documents in the root in stead of it's own sub folder.
I'm not sure how it makes sense to store *data* in your root and *methods* in a subfolder. Life is typically a whole lot easier if you store methods higher up in the hierarchy and data at a lower level... that way you can call a method on any subfolder below it thus: server/path/to/subfolder/method And the magic of Acquisition makes it *just work*. See the Zope Book for details: http://zope.org/Documentation/Books/ZopeBook/2_6Edition/Acquisition.stx So I'd encourage you to rethink your hierarchy as a first step. But if you *really* want to do what you've described, it is possible. Several techniques of getting the root object are documented here: http://www.zopelabs.com/cookbook/1003151229 HTH, Dylan
Helly Dylan, I know what is ' going wrong.
From a Page Template in the root I linked a DTML Method in a sub folder. But this DTML Method is looking for DTML Documents in the root in stead of it's own sub folder.
Do you know a solutiuon for this ? Martin Koekenberg ----- Original Message ----- From: "Dylan Reinhardt" <zope@dylanreinhardt.com> To: "Martin Koekenberg" <zope@digital-adventures.nl> Cc: "Zope Users" <zope@zope.org> Sent: Thursday, November 06, 2003 5:31 PM Subject: Re: [Zope] TAL DTML Method & folder question
On Thu, 2003-11-06 at 07:53, Martin Koekenberg wrote:
This code has to show the last 3 news items (DTML Document's). Something is going wrong with a folder or somethin like that because the DTML Method show no news items. Mayby because there are no DTML Document with the right properties in the root.
Maybe so. First rule of troubleshooting is to test your assumptions.
Start simply... get a list of objects and display their ids... next, restrict the type of object... once that works, restrict by properties, number returned, etc. Somewhere along the way, you'll figure out what you've done wrong.
HTH,
Dylan
participants (2)
-
Dylan Reinhardt -
Martin Koekenberg