I found a way to use an svg as an icon. For the default icons its fine to use a webfont, for custom addons this does not make much sense. Its really to much work for just an silly icon in a control-panel. I'd prefer to get back the icon_expr
.
So here is what I did further reading Strategies for LESS/CSS in addons?):
- add a less file wiring in the icon https://github.com/collective/pas.plugins.authomatic/blob/1.0a1/src/pas/plugins/authomatic/browser/resources/authomatic.less and add the icon itself https://github.com/collective/pas.plugins.authomatic/blob/1.0a1/src/pas/plugins/authomatic/browser/resources/authomatic-logo.svg
- registering as resource https://github.com/collective/pas.plugins.authomatic/blob/1.0a1/src/pas/plugins/authomatic/browser/configure.zcml#L8
- adding a resource and and a bundle(!) to the registry https://github.com/collective/pas.plugins.authomatic/blob/1.0a1/src/pas/plugins/authomatic/profiles/default/registry.xml#L10-L27
- in buildout enable the resource helpers https://github.com/collective/pas.plugins.authomatic/blob/1.0a1/base.cfg#L71-L78
- use coredev versions for this (because of a bug fixed at PloneConf in Products.CMFPlone, release is pending) https://github.com/collective/pas.plugins.authomatic/blob/1.0a1/coredev5.cfg (run buildout!)
- make sure
grunt
is available in your PATH - start your instance
./bin/instance start
, go to browser, create a Plone site namedPlone
with your addon installed - compile resources on commandline - this will install a whole bunch of javascript tools:
./bin/plone-compile-resources --site-id=Plone --compile-dir=./src/pas/plugins/authomatic/browser/resources/ --bundle=authomatic-addon
(which fails today, but worked fine ~2weeks ago ..., need to investigate here)
Lots of work for just an icon, I'd really like to reenable the icon_expr for simple addons.