Evan,

This update breaks my previously working code. My site master template 
calls a dtml component to render a simple menu. This worked with the 
previous release of ZPT, but now results in a Name Error for the PARENTS[] 
variable. What changed in the new release to cause this and how are we now 
supposed to call dtml-components to avoid this problem. (Output Trace, 
dtml-code and object call syntax below)

Regards,

Frank

exceptions.NameError on PARENTS in ""

Traceback (innermost last):
  File /usr/local/www/Zope/lib/python/ZPublisher/Publish.py, line 222, in 
publish_module
  File /usr/local/www/Zope/lib/python/ZPublisher/Publish.py, line 187, in 
publish
  File /usr/local/www/Zope/lib/python/Zope/__init__.py, line 221, in 
zpublisher_exception_hook
    (Object: Traversable)
  File /usr/local/www/Zope/lib/python/ZPublisher/Publish.py, line 171, in 
publish
  File /usr/local/www/Zope/lib/python/ZPublisher/mapply.py, line 160, in 
mapply
    (Object: index_html)
  File /usr/local/www/Zope/lib/python/ZPublisher/Publish.py, line 112, in 
call_object
    (Object: index_html)
  File /usr/local/www/Zope/lib/python/Shared/DC/Scripts/Bindings.py, line 
324, in __call__
    (Object: index_html)
  File /usr/local/www/Zope/lib/python/Shared/DC/Scripts/Bindings.py, line 
353, in _bindAndExec
    (Object: index_html)
  File 
/usr/local/www/Zope/lib/python/Products/PageTemplates/ZopePageTemplate.py, 
line 247, in _exec
    (Object: index_html)
  File 
/usr/local/www/Zope/lib/python/Products/PageTemplates/PageTemplate.py, line 
155, in pt_render
    (Object: index_html)
    (Info: {'container': <Folder instance at 89d5900>,
 'here': <Folder instance at 89d5900>,
 'modules': <Products.PageTemplates.ZopePageTemplate._SecureModuleImporter 
instance at 8a28640>,
 'nothing': None,
 'options': {'args': ()},
 'request': <h3>form</h3><table></table><h3>cookies</h3><table><tr 
valign="top" 
align="left"><th>tree-s</th><td>'eJyLjlZ3hAJXbQtb9dhYACzMBKw'</td></tr><tr 
valign="top" 
align="left"><th>chuckmIMPlang</th><td>'en'</td></tr></table><h3>other</h3>
<table><tr valign="top" 
align="left"><th>AUTHENTICATION_PATH</th><td>''</td></tr><tr valign="top" 
align="left"><th>chuckmIMPlang</th><td>'en'</td></tr><tr valign="top" 
align="left"><th>URL3</th><td>'http://209.48.159.60:8080'</td></tr><tr 
valign="top" 
align="left"><th>URL0</th><td>'http://209.48.159.60:8080/umle/Products/inde
x_html'</td></tr><tr valign="top" 
align="left"><th>BASE3</th><td>'http://209.48.159.60:8080/umle/Products'</t
d></tr><tr valign="top" 
align="left"><th>URL2</th><td>'http://209.48.159.60:8080/umle'</td></tr><tr 
valign="top" 
align="left"><th>BASE1</th><td>'http://209.48.159.60:8080'</td></tr><tr 
valign="top" align="left"><th>traverse_subpath</th><td>[]</td></tr><tr 
valign="top" 
align="left"><th>URL1</th><td>'http://209.48.159.60:8080/umle/Products'</td
></tr><tr valign="top" 
align="left"><th>SERVER_URL</th><td>'http://209.48.159.60:8080'</td></tr><t
r valign="top" 
align="left"><th>tree-s</th><td>'eJyLjlZ3hAJXbQtb9dhYACzMBKw'</td></tr><tr 
valign="top" 
align="left"><th>URL</th><td>'http://209.48.159.60:8080/umle/Products/index
_html'</td></tr><tr valign="top" 
align="left"><th>AUTHENTICATED_USER</th><td>admin</td></tr><tr valign="top" 
align="left"><th>PUBLISHED</th><td>&lt;ZopePageTemplate instance at 
8a9a6e0&gt;</td></tr><tr valign="top" 
align="left"><th>TraversalRequestNameStack</th><td>[]</td></tr><tr 
valign="top" 
align="left"><th>BASE2</th><td>'http://209.48.159.60:8080/umle'</td></tr><t
r valign="top" 
align="left"><th>BASE0</th><td>'http://209.48.159.60:8080'</td></tr><tr 
valign="top" 
align="left"><th>BASE4</th><td>'http://209.48.159.60:8080/umle/Products/ind
ex_html'</td></tr><tr valign="top" 
align="left"><th>URL0</th><td>http://209.48.159.60:8080/umle/Products/index
_html</td></tr><tr valign="top" 
align="left"><th>URL1</th><td>http://209.48.159.60:8080/umle/Products</td><
/tr><tr valign="top" 
align="left"><th>URL2</th><td>http://209.48.159.60:8080/umle</td></tr><tr 
valign="top" 
align="left"><th>URL3</th><td>http://209.48.159.60:8080</td></tr><tr 
valign="top" 
align="left"><th>BASE0</th><td>http://209.48.159.60:8080</td></tr><tr 
valign="top" 
align="left"><th>BASE1</th><td>http://209.48.159.60:8080</td></tr><tr 
valign="top" 
align="left"><th>BASE2</th><td>http://209.48.159.60:8080/umle</td></tr><tr 
valign="top" 
align="left"><th>BASE3</th><td>http://209.48.159.60:8080/umle/Products</td>
</tr><tr valign="top" 
align="left"><th>BASE4</th><td>http://209.48.159.60:8080/umle/Products/inde
x_html</td></tr></table><h3>environ</h3><table><tr valign="top" 
align="left"><th>HTTP_ACCEPT_ENCODING</th><td>gzip, deflate</td></tr><tr 
valign="top" 
align="left"><th>channel.creation_time</th><td>988533067</td></tr><tr 
valign="top" align="left"><th>SERVER_PROTOCOL</th><td>1.1</td></tr><tr 
valign="top" align="left"><th>SERVER_PORT</th><td>8080</td></tr><tr 
valign="top" align="left"><th>PATH_INFO</th><td>/umle/Products</td></tr><tr 
valign="top" 
align="left"><th>HTTP_HOST</th><td>209.48.159.60:8080</td></tr><tr 
valign="top" align="left"><th>REQUEST_METHOD</th><td>GET</td></tr><tr 
valign="top" 
align="left"><th>PATH_TRANSLATED</th><td>/umle/Products</td></tr><tr 
valign="top" 
align="left"><th>HTTP_COOKIE</th><td>tree-s=&quot;eJyLjlZ3hAJXbQtb9dhYACzMB
Kw&quot;; chuckmIMPlang=en; 
tree-s=&quot;eJzTiFZ3hANPW/VYHU0ALlYElA&quot;</td></tr><tr valign="top" 
align="left"><th>SCRIPT_NAME</th><td></td></tr><tr valign="top" 
align="left"><th>SERVER_SOFTWARE</th><td>Zope/Zope 2.3.0 (source release, 
python 1.5.2, linux2) ZServer/1.1b1</td></tr><tr valign="top" 
align="left"><th>HTTP_ACCEPT_LANGUAGE</th><td>en-us,en;q=0.5</td></tr><tr 
valign="top" align="left"><th>HTTP_ACCEPT</th><td>image/gif, 
image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, 
application/vnd.ms-excel, application/msword, application/x-comet, 
*/*</td></tr><tr valign="top" 
align="left"><th>REMOTE_ADDR</th><td>213.177.129.32</td></tr><tr 
valign="top" 
align="left"><th>HTTP_REFERER</th><td>http://209.48.159.60:8080/umle/Librar
y</td></tr><tr valign="top" 
align="left"><th>SERVER_NAME</th><td>bsd.umc2.com</td></tr><tr valign="top" 
align="left"><th>GATEWAY_INTERFACE</th><td>CGI/1.1</td></tr><tr 
valign="top" align="left"><th>HTTP_USER_AGENT</th><td>Mozilla/4.0 
(compatible; MSIE 5.01; Windows NT 5.0)</td></tr><tr valign="top" 
align="left"><th>CONNECTION_TYPE</th><td>Keep-Alive</td></tr></table>,
 'root': <Application instance at 89b8580>,
 'template': <ZopePageTemplate instance at 8a9a6e0>,
 'traverse_subpath': []})
  File /usr/local/www/Zope/lib/python/TAL/TALInterpreter.py, line 198, in 
__call__
  File /usr/local/www/Zope/lib/python/TAL/TALInterpreter.py, line 225, in 
interpret
  File /usr/local/www/Zope/lib/python/TAL/TALInterpreter.py, line 414, in 
do_useMacro
  File /usr/local/www/Zope/lib/python/TAL/TALInterpreter.py, line 225, in 
interpret
  File /usr/local/www/Zope/lib/python/TAL/TALInterpreter.py, line 340, in 
do_insertStructure
  File /usr/local/www/Zope/lib/python/Products/PageTemplates/TALES.py, line 
274, in evaluateStructure
  File /usr/local/www/Zope/lib/python/Products/PageTemplates/TALES.py, line 
256, in evaluate
  File 
/usr/local/www/Zope/lib/python/Products/PageTemplates/Expressions.py, line 
234, in __call__
  File 
/usr/local/www/Zope/lib/python/Products/PageTemplates/Expressions.py, line 
178, in _evalRender
  File 
/usr/local/www/Zope/lib/python/Products/PageTemplates/Expressions.py, line 
131, in render
    (Object: navigator)
  File /usr/local/www/Zope/lib/python/OFS/DTMLMethod.py, line 189, in 
__call__
    (Object: navigator)
  File /usr/local/www/Zope/lib/python/DocumentTemplate/DT_String.py, line 
538, in __call__
    (Object: navigator)
  File /usr/local/www/Zope/lib/python/DocumentTemplate/DT_With.py, line 
133, in render
    (Object: PARENTS[-2])
  File /usr/local/www/Zope/lib/python/DocumentTemplate/DT_Util.py, line 
334, in eval
    (Object: PARENTS[-2])
    (Info: PARENTS)
  File <string>, line 0, in ?
TALESError: (see above)

===========================================
The DTML-CODE in object Navigator:
<dtml-with "PARENTS[-2]">

<dtml-in expr="(objectValues('Folder') or objectValues('ZPhotoAlbum'))">
  <a CLASS="globalmenu" href="&dtml-absolute_url;"><dtml-var 
title_or_id></a><br>
</dtml-in>
<HR NOSHADE SIZE="0.5" WIDTH="95%">
</dtml-with></p>
<dtml-if "PARENTS[-2] <> PARENTS[0]">
<p CLASS="globalmenu">
SUBSECTIONS
<dtml-in expr="(objectValues('Folder') or objectValues('ZPhotoAlbum'))">
  <a CLASS="globalmenu" href="&dtml-absolute_url;"><dtml-var 
title_or_id></a><br>
</dtml-in>
<br><br>
</dtml-if>
=======================================
The Navigator object is called from a master template using the following 
syntax:

<div class="menu" tal:content="structure here/navigator">
   Navigator comes here
   </div>




--On Saturday, April 28, 2001 01:12 -0500 Evan Simpson <[EMAIL PROTECTED]> 
wrote:

> Actually, I uploaded these at 5pm today, then I had to run and catch a
> plane.  I still haven't updated the Project wiki, but if you visit:
>
> http://www.zope.org/Members/4am/ZPT
>
> ...you can pick up the latest.  You need to download all three;
> PageTemplates goes in a Products directory, TAL and ZTUtils go in
> 'lib/python'.
>
> There's a trio of example Page Templates (with support data) that you
> can try out by copying PageTemplates/examples/zpt_examples.zexp into
> your import directory and importing it somewhere.  One of them shows off
> batching, another shows how to make a tree widget, and the third calls
> DTML from ZPT.
>
> Cheers,
>
> Evan @ digicool
>
>
> _______________________________________________
> Zope-Dev maillist  -  [EMAIL PROTECTED]
> 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-Dev maillist  -  [EMAIL PROTECTED]
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 )

Reply via email to