[Zope] Accessing objects properties

Rafael Cordones Marcos rcm@bcnartdirecte.com
Thu, 21 Oct 1999 00:04:55 +0200


Hi,

I have the following structure

   .../Cases/ (a folder)
         show_image (a DTML document)
         Case1/ (a folder)
           figure1 (Image object)
           figure2
           ... 
           figure3 
           content (a DTML document)

from "content" I want to include images with a function, like:

<dtml-var "show_image(img_name = 'figure1')">

and I have implemented "show_image" as:

<div align="center">
<table cellpading="0" cellspacing="0" border="0">
 <tr><td><img src="<dtml-var img_name>" width="300"></td>
 <tr><td><p>****Title of image here.****</p></td>
</table>
</div>

But in order to get the title I have tried several things:

<div align="center">
<table cellpading="0" cellspacing="0" border="0">
 <tr><td><img src="<dtml-var img_name>" width="300"></td>
 <tr><td><p><dtml-var "_.getitem(img_name, 1).title"></p></td>
</table>
</div>

----------------

<div align="center">
<table cellpading="0" cellspacing="0" border="0">
 <tr><td><img src="<dtml-var img_name>" width="300"></td>
 <tr><td><p><dtml-with "_.getitem(img_name, 1)"><dtml-var
 title></dtml-with></p></td>
</table>
</div>

----------------

But I get a Error Type: KeyError, Error Value: figure1

And with

<div align="center">
<table cellpading="0" cellspacing="0" border="0">
 <tr><td><img src="<dtml-var img_name>" width="300"></td>
 <tr><td><p><dtml-var "_.getattr(getitem(img_name, 1), title)"></p></td>
</table>
</div>

I get a "You are not authorized to access title." error when trying to
access "content"

Is this info in the DTML Guide? Any HOWTO? 

Thanks!

Rafa

-- 
Linux. The Choice of a GNU Generation! -> http://www.debian.org