As usual, I blabbered on before I knew what I was talking about. I played some more with this (because I have the same problem in my product) and found that the "Product Icons" section at http://www.zope.org/Members/Zen/howto/ProductAPITutorial does indeed work as documented: Here's our poll's misc_ definition: misc_={ 'poll': ImageFile('poll.gif',globals()), } It only defines one thing--the poll's icon. For your Product's icons you should use 'ImageFile's. Objects defined in a Product's misc_ mapping are made available through the web at /misc_//. To allow Zope to find this icon you need to specify its URL in your Product's class. So here's how we indicate our poll's icon: class Poll: ... icon='misc_/Poll/poll' ... You just have to realize that icon="misc_/<ProductID>/<misc_key>". -- HTH -- Loren From: Loren Stafford <lstaffor@dynalogic.com>
Oops. What I said below doesn't even work in my installation. I guess I can't help much.
I also tried the stuff in the "Product Icons" section at http://www.zope.org/Members/Zen/howto/ProductAPITutorial and it doesn't quite work as documented anymore. But the icon= statement in the Class definition does seem to take some kind of URL.
-- Loren
From: Loren Stafford <lstaffor@dynalogic.com>
I'm not sure; but I inherited some code that works like this:
# Set the icon for the MyClass, because it doesn't act # like a regular object, so I can't use registerClass misc_ = { 'MyClassIcon': ImageFile('www/MyIcon.gif', globals()) }
Apparently, in this case, the ID is constructed as <MyClassID>+'Icon'; because there is no corresponding icon=... statement anywhere. But, I can't find the Zope code that does this; so, I might be deceived.
-- HTH -- Loren, also struggling to write a product
----- Original Message ----- From: Terry Kerr <terry@adroitnet.com.au> To: <zope@zope.org> Sent: February 22, 2000 04:29 PM Subject: [Zope] object icons
Hi,
How can I assign icons to objects within my product. I am only registering one container class in the __init__.py of the product, but want other objects within the product to have icons even tho they are only explicitly created and added by the product itself.
setting an icon='blah.gif' in the class doesn't work. I am having trouble working out what setting this attribute is actually doing.
participants (1)
-
Loren Stafford