RE: [Zope] Recursive method (Funny-peculiar)
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)
Roché Compaan wrote:
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?
I was just replying to your first message when I saw this, I was going to guess that index_html was a DTML Document. DTML Methods are methods of the folder that contains them. So, if 'index_html' were a method, then when it called 'objectValues' it would call it on the *folder* is is contained in. A DTML Document, however, has it's own objectValues method (because a DTML Document is an *object*, not a *method* it can have it's own methods) which, because a Document is not a container, will return nothing. -Michel
Roché (Somewhat smelling the Zen of Zope)
participants (2)
-
Michel Pelletier -
Roché Compaan