[Zope] HTML Document rendering?

Jaroslav Lukesh lsh@wo.cz
Mon, 29 Jul 2002 11:59:34 +0200


Toto je vícedílná zpráva formátu MIME.

------=_NextPart_000_01C236F7.67C54A00
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7Bit

Hi all, 

I do not want to access HTML documents directly via URL, I want to render
these
documents via dtml-var method. So few HTML documents will be rendered into
one page with omit all other than BODY container.

I has DTML pages what are rendered into one page with that method (this is
OK for DTML Document only):

<dtml-in expr="objectValues('DTML Document')" sort=id>
<dtml-if "hasProperty('hide')"><dtml-else>
	<dtml-if "hasProperty('html')">
	<dtml-elif expr="_.string.find(_['id'],'.htm')>0">
		<dtml-var sequence-item>
	<dtml-else>
		<dtml-var sequence-item fmt=structured-text>
	</dtml-if>
</dtml-if>
</dtml-in>

This is fully functional with HTML segments (content between <body>&</body>
tags only) uploaded via FTP and saved as DTML Document. But I want to
upload whole
HTML documents. So I install HTML document product and change dtml-in:

<dtml-in expr="objectValues('DTML Document', 'HTML Document')" sort=id>

then browse page, and I have receive error (see attachment)

navi_CHILD DTML method mentioned in error report is:

<dtml-in "PARENTS[0].objectValues('Folder')" sort=poradi>
	<a href="<dtml-var absolute_url>/" class="navlchild">
		<dtml-var title_or_id></a><br>
</dtml-in>


------=_NextPart_000_01C236F7.67C54A00
Content-Type: application/octet-stream; name="htmlerror.txt"
Content-Description: htmlerror.txt (textový dokument)
Content-Disposition: attachment; filename="htmlerror.txt"
Content-Transfer-Encoding: Quoted-Printable

Zope Error

                         Zope has encountered an error while publishing =
this resource.

                         Error Type: NameError
                         Error Value: global name 'PARENTS' is not =
defined



                         Troubleshooting Suggestions

                                This resource may be trying to reference =
a nonexistent object or variable
                                global name 'PARENTS' is not defined.=20
                                The URL may be incorrect.=20
                                The parameters passed to this resource =
may be incorrect.=20
                                A resource that this resource relies on =
may be encountering an error.=20

                         For more detailed information about the error, =
please refer to the HTML source for
                         this page.=20

                         If the error persists please contact the site =
maintainer. Thank you for your
                         patience.=20




Traceback (innermost last):
  File C:\Program =
Files\zope-web\lukesh251\lib\python\ZPublisher\Publish.py, line 150, in =
publish_module
  File C:\Program =
Files\zope-web\lukesh251\lib\python\ZPublisher\Publish.py, line 114, in =
publish
  File C:\Program Files\zope-web\lukesh251\lib\python\Zope\__init__.py, =
line 159, in zpublisher_exception_hook
    (Object: nokia9210)
  File C:\Program =
Files\zope-web\lukesh251\lib\python\ZPublisher\Publish.py, line 98, in =
publish
  File C:\Program =
Files\zope-web\lukesh251\lib\python\ZPublisher\mapply.py, line 88, in =
mapply
    (Object: index_html)
  File C:\Program =
Files\zope-web\lukesh251\lib\python\ZPublisher\Publish.py, line 39, in =
call_object
    (Object: index_html)
  File C:\Program Files\zope-web\lukesh251\lib\python\OFS\DTMLMethod.py, =
line 127, in __call__
    (Object: index_html)
  File C:\Program =
Files\zope-web\lukesh251\lib\python\DocumentTemplate\DT_String.py, line =
473, in __call__
    (Object: index_html)
  File C:\Program Files\zope-web\lukesh251\lib\python\OFS\DTMLMethod.py, =
line 120, in __call__
    (Object: sys_list-item)
  File C:\Program =
Files\zope-web\lukesh251\lib\python\DocumentTemplate\DT_String.py, line =
473, in __call__
    (Object: sys_list-item)
  File C:\Program =
Files\zope-web\lukesh251\lib\python\DocumentTemplate\DT_In.py, line 695, =
in renderwob
    (Object: objectValues(['HTML Document', 'DTML Document']))
  File C:\Program =
Files\zope-web\lukesh251\lib\python\Products\HTMLDocument\HTMLDocument.py=
, line 189, in __call__
    (Object: 11.htm)
  File C:\Program Files\zope-web\lukesh251\lib\python\OFS\DTMLMethod.py, =
line 127, in __call__
    (Object: standard_html_header)
  File C:\Program =
Files\zope-web\lukesh251\lib\python\DocumentTemplate\DT_String.py, line =
473, in __call__
    (Object: standard_html_header)
  File C:\Program =
Files\zope-web\lukesh251\lib\python\OFS\DTMLDocument.py, line 120, in =
__call__
    (Object: navi_CHILD)
  File C:\Program =
Files\zope-web\lukesh251\lib\python\DocumentTemplate\DT_String.py, line =
473, in __call__
    (Object: navi_CHILD)
  File C:\Program =
Files\zope-web\lukesh251\lib\python\DocumentTemplate\DT_In.py, line 620, =
in renderwob
    (Object: PARENTS[0].objectValues('Folder'))
  File C:\Program =
Files\zope-web\lukesh251\lib\python\DocumentTemplate\DT_Util.py, line =
159, in eval
    (Object: PARENTS[0].objectValues('Folder'))
    (Info: PARENTS)
  File <string>, line 2, in f
NameError: (see above)


------=_NextPart_000_01C236F7.67C54A00--