[Zope-CMF] Icons and new Product seems strange
Dieter Maurer
dieter@handshake.de
Tue, 10 Dec 2002 20:14:05 +0100
Pascal Samuzeau writes:
> Still in my product I have a little problem without a solution.
>
> Considering that I have :
>
> -----------------------------------------------------------
> factory_type_information { 'id' : 'NewID'
> , 'title' : 'NewTitle'
> , 'meta_type' : 'NewMetaType'
> , 'icon' : 'myproducticon.gif'
> ....
> }
>
> class myproduct(SkinnedFolder):
> ...
> -----------------------------------------------------------
>
> Considering that I have in a DTML method :
>
> -------------------------------------------------------------------
> <dtml-in expr="portal_catalog.searchResults(meta_type='NewMetaType')">
> ...
> <dtml-if getIcon>
> <img src="&dtml-portal_url;/&dtml-getIcon;">
> ...
> </dtml-in>
> --------------------------------------------------------------------
>
> I always get, on the HTML page the icon's SkinnedFolder named
> "folder_icon.gif"
>
> So, How can I tell to Zope to get the icon of my product and not the
> inherited one?
A drastic (but safe) way would be to redefine "getIcon".
The mixin class "DynamicType" is responsible for taking
definition from the type factory. Not sure whether "SkinnedFolder"
is a "DynamicType" (use "DocFinder", to find out).
Dieter