I have a standard_html_header/footer pair which works much like that on zope.org. The header inserts a <!--#var sidebar--> in the left column. The sidebar DTML method is: <!--#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? --david
On Thu, 4 Mar 1999, David Ascher wrote:
<!--#in expr="objectValues(['Folder'])"--> <!--#if hidden --> <!--#else --> <a href="<!--#var id-->"><!--#var title--></a><p> <!--#/if --> <!--#/in -->
Check if your DTML properly closes all tags. I had something similar happening to me in a complicated DTML, when some condition failed to add a </TABLE> tag. BTW you can use <!--# unless hidden--> ... <!--# /unless--> Pavlos
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? -- M.J. Pieters, Web Developer | Antraciet http://www.antraciet.nl | Tel: +31-35-6254545 Fax: +31-35-6254555 | mailto:mj@antraciet.nl http://www.antraciet.nl/~mj | PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149 ------------------------------------------
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?
David Ascher wrote:
I have a standard_html_header/footer pair which works much like that on zope.org.
The header inserts a <!--#var sidebar--> in the left column. The sidebar DTML method is:
<!--#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.
Try: <!--#var "sidebar(PARENTS[-1],REQUEST)"--> This will call the method using the root folders' namespace, thereby showing all qualifiying subfolders regardless of where the method is called from. You might have to modify your method to construct absolute URL's. Michael Bernstein.
On Fri, 5 Mar 1999, Michael Bernstein wrote:
Try: <!--#var "sidebar(PARENTS[-1],REQUEST)"-->
This will call the method using the root folders' namespace, thereby showing all qualifiying subfolders regardless of where the method is called from. You might have to modify your method to construct absolute URL's.
Thanks! What I actually wanted was sidebar(PARENTS[0], REQUEST), but you pointed me in the direction I needed. Now I have to understand it, but that's much easier with working code. This also led me to find a bug. I was wondering why the REQUEST parameter was needed, so I tried to remove it. The next time I loaded a page calling this code, the ZServer process died with the Win32 equivalent of a segfault. Is it just me? I don't dare try it on another Zope server =). [Zope 1.10.2, latest ZServer, win32, NT4SP3] --david
I'm new to Zope. I'm very excited about it's potential, but my first impression is that I will need to master Python in order to use it. I believe Python is an excellent language, but I do not have the time to learn it. Several questions about this: - Can I achieve anything useful in Zope without touching Python? I can learn DTML, of course. - if so, what I can and what I cannot do without Python? - could I, for instance, do something like slashdot.org without Python? - is there a plan to give Zope features (or ready-made modules/factories) that would completely eliminate the need to work with Python (for certain tasks that can be automated or turned into templates)? -- Milos Prudek
participants (5)
-
David Ascher -
Martijn Pieters -
Michael Bernstein -
Milos Prudek -
Pavlos Christoforou