Re: [Zope] Re: [Zope-dev] Help needed: why is this DTML not working in zope 2 ?
Thanks Chris, Unfortunatly no, I have already try the new syntax (and a lot of other things). The problem is at the line : <dtml-var "_[_['id']]"> if I change this line with : <dtml-var "_['id']"> my tree works, expand, collapse well, and display the name of my objects, but I want to have the content in case the object name is 'PUBLIC_Doc'. It's why I have use the code <dtml-var "_[_['id']]"> in zope 1, 2 levels of _[, to get the content of the content of the variable id . I try also to use a external method to render the object -> same result. I can get the object code, but the rendering failed, I think it's some acquisition pb. gilles -----Original Message----- From: Chris Withers <chrisw@nipltd.com> To: Gilles Lavaux <gilles.lavaux@esrin.esa.it> Cc: zope@zope.org <zope@zope.org>; zope-dev@zope.org <zope-dev@zope.org> Date: Tuesday, July 04, 2000 11:27 AM Subject: [Zope] Re: [Zope-dev] Help needed: why is this DTML not working in zope 2 ?
You could try moving stuff to the new dtml style for starters: <dtml-var standard_html_header> and the like.
That might help, if not let us know..
cheers,
Chris
Gilles Lavaux wrote:
Hello,
I am a little bit disappointed not getting any echo from my previous question, so I report it. Maybe my dtml is wrong for zope2, but I would appreciate to have some explanation from more experienced peoples. If I can not find a solution, we will have to keep our zope1 production server, and it will be the end of the Zope story in my company :-(
So my question was :
I want to display the content of a site starting from a folder called
'Site'
with a tree tag. I want also to render immediately inside the tree the documents with an ID=='PUBLIC_Doc'. In Zope 1.x I have a working dtml method like this:
<!--#var standard_html_header--> <!--#tree Site branches_expr="objectValues()" sort=id skip_unauthorized--> <b><!--#var id--></b> <!--#if "_['id']=='PUBLIC_Doc'"--> ## <!--#try--> <!--#var "_[_['id']]"--> <!--#except--> <!--#var Except_Message--> <!--#/try--> ## <!--#/if--> <!--#/tree--> <!--#var standard_html_footer-->
Unfortunatly for me , with zope 2.1.6 i get an error when I try to render the 'PUBLIC_Doc' document: ..... PUBLIC_Doc !# Error type:AttributeError Error Message: Error Message:__call__ Error TB:Traceback (innermost last): File "/usr/lib/python1.5/site-packages/DocumentTemplate/DT_Try.py", line 221, in render_try_except result = render_blocks(self.section, md) File "/usr/lib/python1.5/site-packages/DocumentTemplate/DT_Util.py", line 335, in eval return eval(code,globals,d) File "", line 0, in ? File "/usr/lib/python1.5/site-packages/DocumentTemplate/DT_Util.py", line 161, in careful_getitem v=mapping[key] File "/usr/share/zope/lib/python/OFS/DTMLMethod.py", line 146, in __call__ r=apply(HTML.__call__, (self, client, REQUEST), kw) File "/usr/lib/python1.5/site-packages/DocumentTemplate/DT_String.py", line 502, in __call__ try: return render_blocks(self._v_blocks, md) AttributeError: __call__
has someone a solution ??
Thanks,
Gilles
_______________________________________________ Zope-Dev maillist - Zope-Dev@zope.org http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
participants (1)
-
Gilles Lavaux