[Zope] any cleaner or cleverer way of inclusion ?

Paul Winkler pw_lists at slinkp.com
Mon Aug 18 10:41:45 EDT 2003


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)



More information about the Zope mailing list