[Zope-CMF] How to use getProperty and dtml-if with a variable parameter ?

Dieter Maurer dieter@handshake.de
Thu, 21 Nov 2002 19:25:20 +0100


Pascal Samuzeau writes:
 > I need to use of                                                      
 >                                                                       
 > <dtml-let choice="portal_catalog.searchResults(meta_type='Test')">    
 >  <dtml-if "member.&dtml-id;">                                         
 >   <dtml-let property="member.getProperty(&dtml-id;)">                 
 >   </dtml-let>                                                         
 >  </dtml-if>                                                           
 > </dtml-let>                                                           
 >                                                                       
 > But I've got a lot of problem due to &dtml-id;                        
 >                                                                       
 > How can I do?                                                         
You should have some background reading -- really.

Please read the Zope Book and/or

  <http://www.dieter.handshake.de/pyprojects/zope/book/chap3.html>
 
There are also books in French.

You are looking for "computed attriute access": "_.getattr(member,id)".
And you need to understand the use of names in Python expressions
and DTML interpolation.


Dieter