[Zope] question about displaying object content in page template

Andras Frankel Andras.Frankel at ec.gc.ca
Tue Aug 24 13:47:48 EDT 2004


Hello, 

I would like to ask for help concerning page templates.

I created two classes.  First one is called "CatPageTemp", and it has the
property "MyContent" of type TextArea.  MyContent contains HTML encoded
text.

The second class is called "PageLayout", and has a property called
"ModNames" of type tokens.  ModNames contains a list of objects of type
CatPageTemp that reside in folder /SSS/priv.  Note that the folder name is
not explicitly stored in ModNames.

I created a page_template called index_html in PageLayout, whose goal is
to iterate through the object names in ModNames and display the content of
their "MyContent".  Here is the code:

<ul>
<span tal:repeat="item template/ModNames">
<li tal:content="item"></li>
<span tal:define="file python:'/root/SSS/priv/' + item"
      tal:condition="exists:file/MyContent"
      tal:replace="structure file/MyContent"></span>
</span>
</ul>

Now, that doesn't work.  Zope believes that file/MyContent doesn't exist, even 
though it does.  I tried displaying the value of the 
attribute/variable (?) "file", and it indeed is 
/root/SSS/priv/<some_object> which is correct.
    
Can somebody tell me what's wrong and help me how to fix this?

Thanks.

Andras

PS: I am ready to give clarifications if this post is not clear enough.





More information about the Zope mailing list