[Zope] newbe problem with indirection
Perez, Victor
vaperez@bechtel.com
Fri, 17 Sep 1999 10:08:30 -0500
Hi there:
I have a folder with photos of the office team. Since I don't have all
pictures, I want to show a "no photo available" instead, so I've created a
"showpic" method with the follow:
<!--#if "_[pic]"-->
<!--#var "_[pic]"-->
<!--#else-->
<font color="red" size="20pt">?</font><br>(Photo not available)
<!--#/if-->
This method is called from a document the following way:
<!--#var "showpic(_.None,_,pic='img_Some_Guy')"-->
The idea is to have the "no photo available" until I place the proper image
on the folder, but it's not working. If I make it call some image still not
available I get the following error:
Traceback (innermost last):
File E:\Intranet\index\lib\python\ZPublisher\Publish.py, line 877, in
publish_module
File E:\Intranet\index\lib\python\ZPublisher\Publish.py, line 590, in
publish
(Info: /port/team/index_html)
File E:\Intranet\index\lib\python\OFS\DTMLDocument.py, line 213, in
__call__
(Object: index_html)
File E:\Intranet\index\lib\python\OFS\DTMLDocument.py, line 209, in
__call__
(Object: index_html)
File E:\Intranet\index\lib\python\DocumentTemplate\DT_String.py, line 513,
in __call__
(Object: index_html)
File E:\Intranet\index\lib\python\DocumentTemplate\DT_Util.py, line 266,
in eval
(Object: showpic(_.None,_,pic='img_Kevin_Rooney'))
File <string>, line 0, in ?
File E:\Intranet\index\lib\python\OFS\DTMLMethod.py, line 147, in __call__
(Object: showpic)
File E:\Intranet\index\lib\python\DocumentTemplate\DT_String.py, line 513,
in __call__
(Object: showpic)
File E:\Intranet\index\lib\python\DocumentTemplate\DT_Util.py, line 266,
in eval
(Object: _[pic])
File <string>, line 0, in ?
File E:\Intranet\index\lib\python\DocumentTemplate\DT_Util.py, line 150,
in careful_getitem
KeyError: (see above)
where error_value=img_Some_Guy. I've placed the #if tag to avoid this error
but doesn't work. Any ideas?
-
Atentamente,
Victor Perez Muena
IS&T Support - Port Area (Los Vilos)
Los Pelambres Project - Bechtel Chile Ltda.
Ext. 8033, Phone: (2) 361-8033 - Fax: (2) 361-8025