ZMI is an abbreviation for Zope Management Interface. This is the user interface rendered when accessing Zope`s management screens using a web browser.
The free Font Awesome glyphs are used as icons, see the table of available icons.
If you have a Product or package which contains types, which can be added via the ZMI, the default icon will be shown.
To use one of the new icons add an attribute named
zmi_icon to the class.
As value use a name listed on available icons prefixed by
Example to use the info icon (i in a circle):
zmi_icon = 'fas fa-info-circle'
Use custom icons and resources¶
- create a directory and fill it with your assets
- register this directory as resource directory
- register a subscription adapter for
App.interfaces.IJSPaths. This adapter has to return an iterable of paths resp. URLs which should be loaded when rendering the ZMI.
Example taken from zmi.styles:
Register the resource directory via ZCML:
<browser:resourceDirectory name="zmi" directory="resources" />
Create a subscription adapter returning the path to the CSS file (zmi.styles has this code in subscriber.py.):
import zope.component import zope.interface @zope.component.adapter(zope.interface.Interface) def css_paths(context): """Return paths to CSS files needed for the Zope 4 ZMI.""" return ( '/++resource++zmi/bootstrap-4.1.1/bootstrap.min.css', '/++resource++zmi/fontawesome-free-5.1.0/css/all.css', '/++resource++zmi/zmi_base.css', )
Register the subscriber via ZCML:
<subscriber provides="App.interfaces.ICSSPaths" factory=".subscriber.css_paths" />
Use custom resources via ZMI¶
zmi_additional_css_pathsfor additional CSS
The properties can have one of the following types: