[Zope] Simple DTML Method/Acquisition problem

David Ascher da@ski.org
Fri, 5 Mar 1999 10:02:28 -0800 (Pacific Standard Time)


On Fri, 5 Mar 1999, Martijn Pieters wrote:

> At 01:55 05/03/99 , David Ascher wrote:
> ><!--#in expr="objectValues(['Folder'])"-->
> ><!--#if hidden -->
> ><!--#else -->
> ><a href="<!--#var id-->"><!--#var title--></a><p>
> ><!--#/if -->
> ><!--#/in -->
> >
> >(show links to sub-folders which don't have the 'hidden' property set).
> >
> >The above works fine in the toplevel folder.  In the subfolder, however,
> >nothing shows up, even though there are two folders which do qualify.
> >
> >I'd tried originally to have it be a DTML Document and change the expr to
> >_.objectValues(['Folder']), but that doesn't work at all.
> >
> >What am I missing?
> 
> Just a quick shot: Could it be that the value 'hidden' is aquired from
> somewhere else?

Nah -- getting rid of the hidden test doesn't change a thing.  Sorry I
confused the issue with that.

I think my problem has to do with my lack of understanding of the
interactions between acquitision, DTML Methods, DTML docs and namespaces.  
I just noticed that the standard html headers and footers are methods.  
That means, if I understand the earlier email, that the default namespace
in them is that of the thing they are contained in.  So, in my case, the
top-level Folder.

Now, in the sub-folder, the standard html headers and footers are acquired
from the toplevel folder.  The standard header does a #var sidebar, which
also lives in the toplevel folder, and that gets included fine.  Within
that sidebar, I'm not sure what the default namespace is -- my fuzzy
understanding makes me think that it should be either:

  a) the / Folder (the 'physical' container for the DTMLMethods)

  b) the sub Folder (the container for the thing which did the
     aqcuisition, namely the index_html DTML Document.

Problem is, neither of these makes sense given what I'm seeing.  If it was
a), I'd expect the 'objectValues()' call to return the same list of the
subfolders of the toplevel folder every time.  If it was b), I'd expect
the thing to work and give me the subfolders of the subfolder.

Let me try to summarize the hierarchy:
  
   /
     - index_html  (#var standard_html_header...#var standard_html_footer)
     - standard_html_header (#var sidebar)
     - standard_html_footer
     - sidebar
     SubFolder1/
     SubFolder2/
        - index_html  (#var standard_html_header...
                       #var standard_html_footer)
        - SubSubFolder1
        - SubSubFolder2       
    
The top sidebar shows SubFolder1 and SubFolder2, the /SubFolder2 sidebar
doesn't show a thing.

--david

PS: Thanks to pavlos for pointing out the #unless tag.

PS: For some reason the title of the root folder is "Zope" in the
    properties tag but doesn't show up in the tree or in the pathlinks.
    Anyone have a suggestion?