问题
In using Plone, I had the need to use image maps. So I added this product to my build. However, I noted that I was not able to use the product in my application. After investigation, I noticed that this particular product had specified specific themes to be used i.e. the plone default themes.
Here is the skins.xml from the product:
<?xml version="1.0"?>
<object name="portal_skins" allow_any="False" cookie_persistence="False">
<object name="zopyx_tinymceplugins_imgmap"
meta_type="Filesystem Directory View"
directory="zopyx.tinymceplugins.imgmap:skins/zopyx_tinymceplugins_imgmap"/>
<skin-path name="Plone Default">
<layer name="zopyx_tinymceplugins_imgmap"
insert-after="custom"/>
</skin-path>
<skin-path name="Sunburst Theme">
<layer name="zopyx_tinymceplugins_imgmap"
insert-after="custom"/>
</skin-path>
</object>
Now my application has a specific theme i.e. MyCustomTheme. When I activate it, I am unable to use the features of the addon product, but when I revert to the Plone default theme, it works OK. This I deduce is from the hardcoding of the themes within that particular product.
How can I fix this to ensure that MyCustomTheme will always be able to use the product? I am thinking of editing my skins.xml file and include the product as a dependency.
UPDATE: The authors of the product have finally fixed the bug. The latest version of the product from 0.3.2 should now work OK for all skins.
回答1:
You need to add the same layer (zopyx_tinymceplugins_imgmap
) to your own theme too; it is not dependent on the Default skin, but the author forgot to add a wild-card definition to register the layer with all skins.
If you already have a skins.xml
file for your own theme, simply add the same layer definition to it:
<skin-path name="Your Theme Name">
<layer name="zopyx_tinymceplugins_imgmap"
insert-after="custom"/>
<!-- your other skin layer definitions -->
</skin-path>
Make sure you add this product's generic setup profile to your own profile's medadata.xml
dependencies:
<dependencies>
<dependency>profile-zopyx.tinymceplugins.imgmap:default</dependency>
<!-- any other dependencies -->
</dependencies>
and run your setup profile again.
来源:https://stackoverflow.com/questions/13227481/plone-overriding-skins-xml-of-another-product