[Zope] Recursive method (Funny-peculiar)

Roché Compaan sparroy@adept.co.za
Sun, 22 Aug 1999 16:37:43 +0200


> > > DTML Method 'start':
> > >
> > > <!--#var standard_html_header-->
> > >   <!--#var voodoo-->
> > > <!--#var standard_html_footer-->
> > >
> > > DTML Method 'voodoo':
> > >
> > > <!--#in "objectValues('Folder')"-->
> > >   <!--#var id-->
> > >   <a href="<!--#var absolute_url-->"><!--#var absolute_url--></a><br>
> > >   <!--#var voodoo--><br>
> > > <!--#/in-->
> > >
> > > sentence, try it, it will work for you).
> > >
> > > Welcome to the Zen of Zope. ;)
> > >
> > > -Michel
> This makes perfect sense.  What does not make sense is that it
> does not work.
>
> In my top level folder i have a dtml method "navigation":
>
> <!--#in "objectValues(['Folder', 'DTML Document'])"-->
>   <!--#if "meta_type == 'Folder'"-->
>   <tr><td>
>     <a href="<!--#var absolute_url-->"><!--#var id--></a>
>   </td></tr>
>   <!--#var navigation-->
>   <!--#/if-->
> <!--#/in-->
>
> Also in my top level folder i have my "standard_html_header",
> which references the "navigation" method.
>
> What is funny is that if i view my "standard_html_header" it
> renders the whole hierarchy.  If i view "index_html" which
> references "standard_html_header" it does not render the folder
> hierarchy at all.
>
I think i found the solution.  I thought that my "standard_html_header" in
my top level would suffice as the "start" method, and my "navigation" method
is similar to the "voodoo" method.  My public interface "index_html" is a
dtml document.  When i changed "index_html" to a dtml method everything
worked.  So now from within "index_html" i just call "<!--#var
#dtContent"--> to render the content.

It is still peculiar to me why "Objectvalues('Folder')" has no values when
you call it from a dtml document but has values when you call it from a dtml
method.  Why is this the case?

Roché (Somewhat smelling the Zen of Zope)