[Zope-CMF] need to link one folder from another
Dieter Maurer
dieter@handshake.de
Tue, 15 Apr 2003 20:33:12 +0200
Dieter Maurer wrote at 2003-4-14 21:08 +0200:
> Rocky Burt wrote at 2003-4-13 23:54 -0400:
> > ....
> >
> > 3. Reference
> > If I add create a Reference with an id that exists in the skin path, bizarre things occur. All of a sudden all items in portal_skins (all skin directories) show up with broken product icons. If I add a Reference with an id that doesn't exist in the skin path, it behaves how I would expect. But there's not much use for a folder in portal_skins if I can't actually add it to the skin path :/
>
> I can reproduce the problem and may find time to look into it in the
> next few days.
It was something very harmless, although I agree that it looked
disturbing.
What happens:
"OFS/dtml/main.dtml" (the template used to generate an
ObjectManager's "Contents" tab) supports
an "om_icons" attribute. It allows to compose
an icon out of several individual icons.
"Reference" uses this to prepend its icon
to the icon of the object it is pointing to.
Most Zope objects do not define "om_icons" and
"main.dtml" falls then back to "icon".
By the SkinTool's magic, however, all objects in
the portal appear to have an "om_icons" method
as soon as a single object on the skins list
has one. In your case, it is the "Reference"
"om_icons". It tries to find its target and fails,
therefore, the generated icon is "reference to broken".
When you want to get rid of these strange icons, you
can define "om_items" in "OFS.SimpleItem.Item" as:
def om_icons(self):
icon= self.icon
if icon:
return { 'title' : self.meta_type, 'alt' : self.meta_type, 'path' : icon},
Dieter