[Zope] ZPT and ZClass

Kevin Worth kworth@engin.umich.edu
Tue, 13 May 2003 11:27:49 -0400


--============_-1159282826==_ma============
Content-Type: text/plain; charset="us-ascii" ; format="flowed"

I'm trying to transition a site from DTML to ZPT.   I have some 
ZClasses that I would like to use "as is" until I get a chance to 
rewrite them.

When I try to display an object in a Page Template, it fails (the 
Zlcass instance is called "bubbles" and is a folderish object with a 
few properties and contains a Photo

Here is what I try to make it work:
<span tal:replace="structure container/bubbles"/>
Result is the page is rendered with nothing where the object should 
be.  If I view the source of the rendered page I see <highlight at 
bubbles> where the object (a highlight named bubbles) should be.

Then I tried:
<span tal:replace="structure container/bubbles/index_html"/>
Result is:
Error Type: NameError
Error Value: global name 'caption' is not defined

"Caption" is a property of the object.  index_html is a DTML method

Am I trying to do the impossible, or am I missing something?

Kevin
--============_-1159282826==_ma============
Content-Type: text/html; charset="us-ascii"

<!doctype html public "-//W3C//DTD W3 HTML//EN">
<html><head><style type="text/css"><!--
blockquote, dl, ul, ol, li { padding-top: 0 ; padding-bottom: 0 }
 --></style><title>ZPT and ZClass</title></head><body>
<div>I'm trying to transition a site from DTML to ZPT.&nbsp;&nbsp; I
have some ZClasses that I would like to use &quot;as is&quot; until I
get a chance to rewrite them.</div>
<div><br></div>
<div>When I try to display an object in a Page Template, it fails (the
Zlcass instance is called &quot;bubbles&quot; and is a folderish
object with a few properties and contains a Photo</div>
<div><br></div>
<div>Here is what I try to make it work:</div>
<div>&lt;span tal:replace=&quot;structure
container/bubbles&quot;/&gt;</div>
<div>Result is the page is rendered with nothing where the object
should be.&nbsp; If I view the source of the rendered page I see
&lt;highlight at bubbles&gt; where the object (a highlight named
bubbles) should be.</div>
<div><br></div>
<div>Then I tried:</div>
<div>&lt;span tal:replace=&quot;structure
container/bubbles/index_html&quot;/&gt;</div>
<div>Result is:</div>
<div><font face="Helvetica" size="-4" color="#000000"><b>Error Type:
NameError</b></font></div>
<div><font face="Helvetica" size="-4" color="#000000"><b>Error Value:
global name 'caption' is not defined</b></font></div>
<div><br></div>
<div>&quot;Caption&quot; is a property of the object.&nbsp; index_html
is a DTML method</div>
<div><br></div>
<div>Am I trying to do the impossible, or am I missing
something?</div>
<div><br></div>
<div>Kevin</div>
</body>
</html>
--============_-1159282826==_ma============--