any cleaner or cleverer way of inclusion ?
hi from a newbie to zope. i read about zope for my problem but could not find any solution which seems logical to me. i have a folder hierarchy which has "index_html(dtml doc)", "left(dtml mtd)", "main(dtml mtd)" etc in the root folder, and "my_index(dtml method)" in all folders. (index_html has <dtml-var left><dtml-var main>) when i add "my_index" at the "main" (<dtml-var my_index>)and call say "http://xxx/Something/Otherthing", i saw "my_index" which is at the root, not the one inside "Something/Otherthing". but if i write <dtml-in expr="PARENTS[0].objectValues('DTML Method')" > <dtml-return my_index> </dtml-in> i got the expected result, Something/Otherthing/my_index is shown instead of the one at the root folder. there should be a cleaner way ! any idea? thanks ...
On Mon, Aug 18, 2003 at 09:04:51AM +0300, Can Burak Cilingir wrote:
i have a folder hierarchy which has "index_html(dtml doc)", "left(dtml mtd)", "main(dtml mtd)" etc in the root folder, and "my_index(dtml method)" in all folders. (index_html has <dtml-var left><dtml-var main>)
when i add "my_index" at the "main" (<dtml-var my_index>)and call say "http://xxx/Something/Otherthing", i saw "my_index" which is at the root, not the one inside "Something/Otherthing".
I think this is because index_html is a dtml document. Try replacing it with a dtml method. A DTML Document has its own properties, it is not treated as a simple method call at the place where you call it. Names are looked up first in the Document itself, then acquired *by containment first*, then finally by context. So "Otherthing" would be checked only after index_html's containment path. On the other hand, DTML Methods have no properties of their own. They are treated as methods of the calling context. So "Otherthing" would be checked first. http://old.zope.org/Members/michel/HowTos/DTMLMethodsandDocsHowTo -- Paul Winkler http://www.slinkp.com Look! Up in the sky! It's THE TRONIC REPAIRMAN! (random hero from isometric.spaceninja.com)
I think this is because index_html is a dtml document. Try replacing it with a dtml method.
thanks ! thats my answer because it doesn't differ for me if it is a method or document (at least for now). i choosed as document because i feel this is a document instead of a method. because it is the main "document" or default "document". just as the traditional apache name. :) now i just have <dtml-var my_index> and i am more comfortable. :)
http://old.zope.org/Members/michel/HowTos/DTMLMethodsandDocsHowTo
thanks for the address..
Can Burak Cilingir wrote at 2003-8-18 09:04 +0300:
i read about zope for my problem but could not find any solution which seems logical to me.
i have a folder hierarchy which has "index_html(dtml doc)", "left(dtml mtd)", "main(dtml mtd)" etc in the root folder, and "my_index(dtml method)" in all folders. (index_html has <dtml-var left><dtml-var main>)
Make your "index_html" a DTML Method (rather than a DTML Document). This may solve your problem. As a general rule: avoid DTML Document unless you know precisely why your want to use them. Dieter
participants (3)
-
Can Burak Cilingir -
Dieter Maurer -
Paul Winkler