[Zope] Re: [Zope-dev] Help needed: why is this DTML not working in zope 2 ?

Chris Withers chrisw@nipltd.com
Tue, 04 Jul 2000 10:27:51 +0100


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 )