[Zope product] How to register an icon for an abstract superclass ?
Hi all, I aim to have a ZMI icon shared by many classes who inherit from the same superclass. As I didn't want those class appear in the ZMI "add object" choice list, I didn't register them in the .init file. Well, how to register only the icon in association with the superclass, without registering constructors ? Sinclair
Sinclair wrote:
Well, how to register only the icon in association with the superclass, without registering constructors ?
Try making it the _icon atribute of the superclass. I may be misspelling that, have a look at some of the classes in lib/python/OFS or Products/OFSP and see what you can find... Chris
Sinclair wrote at 2003-9-2 16:30 +0200:
I aim to have a ZMI icon shared by many classes who inherit from the same superclass.
As I didn't want those class appear in the ZMI "add object" choice list, I didn't register them in the .init file.
You can register the class but with the "visible=0" paramter. Alternatively, you can use the old "misc" feature: "misc" is a dictionary mapping ids to objects (e.g. "ImageFile" objects). When the product initialization code find a "misc" variable in the module, it publishes its content under: /misc_/<product_name>/id You can then define "icon= '/misc_/<product_name>/id'" in your class. Dieter
Thanks for those useful explanations. Is there any documentation about all the zope start mechanism ?
You can register the class but with the "visible=0" paramter.
Alternatively, you can use the old "misc" feature:
"misc" is a dictionary mapping ids to objects (e.g. "ImageFile" objects). When the product initialization code find a "misc" variable in the module, it publishes its content under:
/misc_/<product_name>/id
You can then define "icon= '/misc_/<product_name>/id'" in your class.
participants (3)
-
Chris Withers -
Dieter Maurer -
Sinclair