Hi, I have been trying to create a site making use of the dtml-tree tag. To get started I tried to follow the "Inplementing a navigation tree" section of the Zbook tutorials. I entered everything more or less exactly as was printed (I made some changes to the HTML output). Everything seems to display correctly when I initially view the page (a tree of my "Outline" folder is displayed), however whenever I click on any of the sub-folders I get the error to be found at the end of this email. Can anyone give me a pointer as to what is going wrong? Also, on a general point - is there any effort being made to make the error reporting system more newbie friendly? Ian. Traceback (innermost last): File /home/zope/Zope/lib/python/ZPublisher/Publish.py, line 214, in publish_module File /home/zope/Zope/lib/python/ZPublisher/Publish.py, line 179, in publish File /home/zope/Zope/lib/python/Zope/__init__.py, line 201, in zpublisher_exception_hook (Object: ElementWithAttributes) File /home/zope/Zope/lib/python/ZPublisher/Publish.py, line 165, in publish File /home/zope/Zope/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: main) File /home/zope/Zope/lib/python/ZPublisher/Publish.py, line 102, in call_object (Object: main) File /home/zope/Zope/lib/python/OFS/DTMLDocument.py, line 166, in __call__ (Object: main) File /home/zope/Zope/lib/python/DocumentTemplate/DT_String.py, line 502, in __call__ (Object: main) File /home/zope/Zope/lib/python/OFS/DTMLMethod.py, line 141, in __call__ (Object: standard_html_header) File /home/zope/Zope/lib/python/DocumentTemplate/DT_String.py, line 502, in __call__ (Object: standard_html_header) File /home/zope/Zope/lib/python/OFS/DTMLDocument.py, line 162, in __call__ (Object: ll_menu) File /home/zope/Zope/lib/python/DocumentTemplate/DT_String.py, line 502, in __call__ (Object: ll_menu) File /home/zope/Zope/lib/python/TreeDisplay/TreeTag.py, line 151, in render (Object: Outline) AttributeError: __call__ -- Ian Clarke Email: I.Clarke@strs.co.uk Homepage: http://www.gnu.demon.co.uk/ Also see: http://freenet.on.openprojects.net/ "All we see and all we seem is but a dream within a dream"
Hi Ian, Could you post the dtml code you are using? I think I know the answer but need to see the code to make sure ;) Phil phil@philh.org -----Original Message----- From: clarkeia@zope.org [mailto:clarkeia@zope.org]On Behalf Of Ian Clarke Sent: Friday, October 15, 1999 10:08 AM To: zope@zope.org Subject: [Zope] Problems with <dtml-tree> Hi, I have been trying to create a site making use of the dtml-tree tag. To get started I tried to follow the "Inplementing a navigation tree" section of the Zbook tutorials. I entered everything more or less exactly as was printed (I made some changes to the HTML output). Everything seems to display correctly when I initially view the page (a tree of my "Outline" folder is displayed), however whenever I click on any of the sub-folders I get the error to be found at the end of this email. Can anyone give me a pointer as to what is going wrong? Also, on a general point - is there any effort being made to make the error reporting system more newbie friendly? Ian. Traceback (innermost last): File /home/zope/Zope/lib/python/ZPublisher/Publish.py, line 214, in publish_module File /home/zope/Zope/lib/python/ZPublisher/Publish.py, line 179, in publish File /home/zope/Zope/lib/python/Zope/__init__.py, line 201, in zpublisher_exception_hook (Object: ElementWithAttributes) File /home/zope/Zope/lib/python/ZPublisher/Publish.py, line 165, in publish File /home/zope/Zope/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: main) File /home/zope/Zope/lib/python/ZPublisher/Publish.py, line 102, in call_object (Object: main) File /home/zope/Zope/lib/python/OFS/DTMLDocument.py, line 166, in __call__ (Object: main) File /home/zope/Zope/lib/python/DocumentTemplate/DT_String.py, line 502, in __call__ (Object: main) File /home/zope/Zope/lib/python/OFS/DTMLMethod.py, line 141, in __call__ (Object: standard_html_header) File /home/zope/Zope/lib/python/DocumentTemplate/DT_String.py, line 502, in __call__ (Object: standard_html_header) File /home/zope/Zope/lib/python/OFS/DTMLDocument.py, line 162, in __call__ (Object: ll_menu) File /home/zope/Zope/lib/python/DocumentTemplate/DT_String.py, line 502, in __call__ (Object: ll_menu) File /home/zope/Zope/lib/python/TreeDisplay/TreeTag.py, line 151, in render (Object: Outline) AttributeError: __call__ -- Ian Clarke Email: I.Clarke@strs.co.uk Homepage: http://www.gnu.demon.co.uk/ Also see: http://freenet.on.openprojects.net/ "All we see and all we seem is but a dream within a dream" _______________________________________________ Zope maillist - Zope@zope.org http://www.zope.org/mailman/listinfo/zope (Related lists - please, no cross posts or HTML encoding! To receive general Zope announcements, see: http://www.zope.org/mailman/listinfo/zope-announce For developer-specific issues, zope-dev@zope.org - http://www.zope.org/mailman/listinfo/zope-dev )
Phil Harris wrote:
Hi Ian,
Could you post the dtml code you are using?
Sure, here are the two pages that are of interest, they have been cut straight from the tutorial except I have changed zb_menu to ll_menu: ll_menu (was zb_menu in tutorial): <SPAN CLASS="tree"> <!--#tree Outline branches_expr="objectValues(['Folder', 'DTML Document'])" nowrap=1 sort=id--> <!--#if expr="meta_type == 'Folder'"--> <!--#if tree-item-expanded--> <IMG SRC="<!--#var SCRIPT_NAME-->/HelpSys/hs_obook" ALIGN="TOP" BORDER="0" width=16 height=16> <!--#else--> <IMG SRC="<!--#var SCRIPT_NAME-->/HelpSys/hs_cbook" ALIGN="TOP" BORDER="0" width=16 height=16> <!--#/if--> <!--#var title_or_id--> <!--#else--> <IMG SRC="<!--#var SCRIPT_NAME-->/HelpSys/hs_dnode" ALIGN="TOP" BORDER="0" width=16 height=16> <A HREF="<!--#var "Outline.absolute_url()"-->/ <!--#var tree-item-url-->? <!--#if tree-s-->tree-s=<!--#var tree-s--><!--#/if--> <!--#if tree-e-->&tree-e=<!--#var tree-e--><!--#/if--> <!--#if tree-c-->&tree-c=<!--#var tree-c--><!--#/if-->"> <!--#var title_or_id--></a> <!--#/if--> <!--#/tree--> </SPAN> standard_html_header: <HTML> <HEAD> <TITLE><!--#var title_or_id--></TITLE> <!--#var css_sheet--> </HEAD> <BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#008080" VLINK="#000080"> <TABLE WIDTH="100%" BORDER=0> <TR VALIGN=TOP> <TD><!--#var ll_menu--></TD> <TD> </TD> <TD><!-- start of content--> Cheers, Ian. -- Ian Clarke Email: I.Clarke@strs.co.uk Homepage: http://www.gnu.demon.co.uk/ Also see: http://freenet.on.openprojects.net/ "All we see and all we seem is but a dream within a dream"
I think the problem is that the line that builds the URL has carriage returns in it, this causes problems. I had exactly the same problem, and removing the CR's fixed it so the lines: <A HREF="<!--#var "Outline.absolute_url()"-->/ <!--#var tree-item-url-->? <!--#if tree-s-->tree-s=<!--#var tree-s--><!--#/if--> <!--#if tree-e-->&tree-e=<!--#var tree-e--><!--#/if--> <!--#if tree-c-->&tree-c=<!--#var tree-c--><!--#/if-->"> <!--#var title_or_id--></a> Should be concatenated, like so (this will wrap in the mail but is meant to be one line): <A HREF="<!--#var "Outline.absolute_url()"-->/<!--#var tree-item-url-->?<!--#if tree-s-->tree-s=<!--#var tree-s--><!--#/if--><!--#if tree-e-->&tree-e=<!--#var tree-e--><!--#/if--><!--#if tree-c-->&tree-c=<!--#var tree-c--><!--#/if-->"><!--#var title_or_id--></a> HTH Phil phil@philh.org -----Original Message----- From: clarkeia@smtp.webprovider.com [mailto:clarkeia@smtp.webprovider.com]On Behalf Of Ian Clarke Sent: Friday, October 15, 1999 10:25 AM To: Phil Harris Cc: zope@zope.org Subject: Re: [Zope] Problems with <dtml-tree> Phil Harris wrote:
Hi Ian,
Could you post the dtml code you are using?
Sure, here are the two pages that are of interest, they have been cut straight from the tutorial except I have changed zb_menu to ll_menu: ll_menu (was zb_menu in tutorial): <SPAN CLASS="tree"> <!--#tree Outline branches_expr="objectValues(['Folder', 'DTML Document'])" nowrap=1 sort=id--> <!--#if expr="meta_type == 'Folder'"--> <!--#if tree-item-expanded--> <IMG SRC="<!--#var SCRIPT_NAME-->/HelpSys/hs_obook" ALIGN="TOP" BORDER="0" width=16 height=16> <!--#else--> <IMG SRC="<!--#var SCRIPT_NAME-->/HelpSys/hs_cbook" ALIGN="TOP" BORDER="0" width=16 height=16> <!--#/if--> <!--#var title_or_id--> <!--#else--> <IMG SRC="<!--#var SCRIPT_NAME-->/HelpSys/hs_dnode" ALIGN="TOP" BORDER="0" width=16 height=16> <A HREF="<!--#var "Outline.absolute_url()"-->/ <!--#var tree-item-url-->? <!--#if tree-s-->tree-s=<!--#var tree-s--><!--#/if--> <!--#if tree-e-->&tree-e=<!--#var tree-e--><!--#/if--> <!--#if tree-c-->&tree-c=<!--#var tree-c--><!--#/if-->"> <!--#var title_or_id--></a> <!--#/if--> <!--#/tree--> </SPAN> standard_html_header: <HTML> <HEAD> <TITLE><!--#var title_or_id--></TITLE> <!--#var css_sheet--> </HEAD> <BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#008080" VLINK="#000080"> <TABLE WIDTH="100%" BORDER=0> <TR VALIGN=TOP> <TD><!--#var ll_menu--></TD> <TD> </TD> <TD><!-- start of content--> Cheers, Ian. -- Ian Clarke Email: I.Clarke@strs.co.uk Homepage: http://www.gnu.demon.co.uk/ Also see: http://freenet.on.openprojects.net/ "All we see and all we seem is but a dream within a dream"
Phil Harris wrote:
I think the problem is that the line that builds the URL has carriage returns in it, this causes problems.
I made the changes you suggested but unfortunately I am still getting that error. Am I correct in saying that if there was a problem with the HTML formatting then the browser would pick it up, not Zope? This leads me to suspect that it is a problem - possibly with namespaces or something. Ian. -- Ian Clarke Email: I.Clarke@strs.co.uk Homepage: http://www.gnu.demon.co.uk/ Also see: http://freenet.on.openprojects.net/ "All we see and all we seem is but a dream within a dream"
Ian, One of the first things I did as a newbie was try to create a tree navigator using the tutorial. I never did get it to work as described in the tutorial. I settled for something simpler (included below), but at least it works. I know you are trying to do something else, but maybe this will server as a working starting point. -- Loren <!-- begin Navigation Tree --> <!--#unless expr="PARENTS[-1]==PARENTS[0]"--> <a href="/">Home</a> <!--#/unless expr="PARENTS[-1]==PARENTS[0]"--> <!--#tree expr="PARENTS[-1]" branches_expr="objectValues(['Folder', 'Confera Topic'])" nowrap=1 sort=id single=1 skip_unauthorized=1--> <!--#unless noindex--> <A HREF="<!--#var "absolute_url()"-->? <!--#if tree-s-->tree-s=<!--#var tree-s--><!--#/if--> <!--#if tree-e-->&tree-e=<!--#var tree-e--><!--#/if--> <!--#if tree-c-->&tree-c=<!--#var tree-c--><!--#/if-->"> <!--#var id--></a> <!--#/unless--> <!--#/tree--> <!-- end Navigation Tree -->
-----Original Message----- From: clarkeia@zope.org [mailto:clarkeia@zope.org]On Behalf Of Ian Clarke Sent: Friday, October 15, 1999 02:45 To: zope@zope.org Subject: [Zope] No improvement :-(
Phil Harris wrote:
I think the problem is that the line that builds the URL has carriage returns in it, this causes problems.
I made the changes you suggested but unfortunately I am still getting that error. Am I correct in saying that if there was a problem with the HTML formatting then the browser would pick it up, not Zope? This leads me to suspect that it is a problem - possibly with namespaces or something.
Ian.
-- Ian Clarke Email: I.Clarke@strs.co.uk Homepage: http://www.gnu.demon.co.uk/ Also see: http://freenet.on.openprojects.net/ "All we see and all we seem is but a dream within a dream"
_______________________________________________ Zope maillist - Zope@zope.org http://www.zope.org/mailman/listinfo/zope
(Related lists - please, no cross posts or HTML encoding!
To receive general Zope announcements, see: http://www.zope.org/mailman/listinfo/zope-announce
For developer-specific issues, zope-dev@zope.org - http://www.zope.org/mailman/listinfo/zope-dev )
Loren Stafford wrote:
Ian,
One of the first things I did as a newbie was try to create a tree navigator using the tutorial. I never did get it to work as described in the tutorial. I settled for something simpler (included below), but at least it works. I know you are trying to do something else, but maybe this will server as a working starting point.
Great, the only thing is that this draws a tree from the root of the Zope directory structure, how can I modify it to start from within a folder? On a more general point, it is somewhat dissappointing that a tutorial intended for beginners is flawed in this way, such a thing could quickly give newbies a bad taste in their mouth regarding Zope. Ian. -- Ian Clarke Email: I.Clarke@strs.co.uk Homepage: http://www.gnu.demon.co.uk/ Also see: http://freenet.on.openprojects.net/ "All we see and all we seem is but a dream within a dream"
Ian Clarke wrote:
Great, the only thing is that this draws a tree from the root of the Zope directory structure, how can I modify it to start from within a folder?
<dtml-tree content> will start inside the content folder.
On a more general point, it is somewhat dissappointing that a tutorial intended for beginners is flawed in this way, such a thing could quickly give newbies a bad taste in their mouth regarding Zope.
urm, I don't know... Have you downloaded the DTML guide? It explains the tree fairly well, I thought. I'd strongly recommend downloading the ZCMG: http://www.zope.org/Documentation/ZCMG the DTML reference: http://www.zope.org/Documentation/DTML and a copy of the Zope Quick Reference (a most worthy document) http://www.zope.org/Members/ZQR -- mindlace Disclaimer: Any use of this email, in any manner whatsoever, will increase the amount of disorder in the universe. Although no liability is implied herein, the reader is warned that this process will ultimately lead to the heat death of the universe.
participants (4)
-
Ethan Fremen -
Ian Clarke -
Loren Stafford -
Phil Harris