Logo in policy, not theme

What is the most reasonable way to have a custom logo in a policy product in Plone 5? Using something encoded inside XML for plone.site_logo in registry seems painful, using portal_skins is doable, but is there not a way to use a URL to a static resource?

I'm not looking to do this in Diazo, because I have multiple sites, each with their own policy, but sharing a single theme.

Sean

Doesn't answer your question but it is possible to have subthemes where you include the diazo from a shared base theme. Although from memory it had some annoying limitation like share resources like CSS or something similar :frowning:

Can't you just override the logo viewlet in your theme ?

I use the "registry way" via encoded xml. It's not painful, perhaps overelaborate.

<record
  interface="Products.CMFPlone.interfaces.ISiteSchema"
  prefix="plone"
  field ="site_logo">
  <value purge="False">filenameb64:...;datab64:....</value>
</record>

That is my likely direction; one of the add-ons all these sites share already overrides the logo viewlet for a different purpose (TTW subsite logos), so I suppose extending what I already have to support a resource URL stored in registry is the logical conclusion (would be nice to see that OOTB some day, though, as alternative to stuffing a base64-encoded image in registry.xml).

Sean

According to the code, when site_logo is set to empty value, "logo.png" from portal root is shown. So, setting empty value and creating /logo.png using GenericSetup's structure import should work.

Any downside for including z3c.jbot and adding a plone.app.layout.viewlets.logo.pt (where you could define logo src url) or a more directly Products.CMFPlone.skins.plone_images.logo.png to its overrides folder?

Hey this is fun.

I've tried that with the base64 encoded Plone SVG Logo from here: https://upload.wikimedia.org/wikipedia/commons/d/df/Plone-logo.svg ... b64encoded filename: plone_logo.svg ... result in my policy registry.xml:

<record name="plone.site_logo">
    <value purge="true">filenameb64:cGxvbmVfbG9nby5zdmc=;datab64:PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxMy4wLjEsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDE0OTQ4KSAgLS0+DQo8IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9y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jAyMSwwLjgyNS0xLjg0OSwxLjg0Ni0xLjg1MWMxLjAyMywwLjAwMiwxLjg1MiwwLjgyOCwxLjg1NCwxLjg1MUMxNTUuODM2LDEzLjE0MSwxNTUuMDA4LDEzLjk2NiwxNTMuOTg1LDEzLjk2OHoiLz4NCgk8L2c+DQoJPGc+DQoJCTxwYXRoIGZpbGw9IiMwMDk1RDMiIGQ9Ik0xNTQuNTA3LDEzLjQwOWwtMC41NC0xLjA4aC0wLjQ4NnYxLjA4aC0wLjM4OXYtMi41NjRoMC45OTRjMC40ODQsMCwwLjc5NiwwLjMxMywwLjc5NiwwLjc1DQoJCQljMCwwLjM2Ny0wLjIyNCwwLjYwMi0wLjUxMywwLjY4bDAuNTkyLDEuMTM2TDE1NC41MDcsMTMuNDA5TDE1NC41MDcsMTMuNDA5eiBNMTU0LjA1NiwxMS4xOTVoLTAuNTc1djAuODAzaDAuNTc1DQoJCQljMC4yNjEsMCwwLjQzNy0wLjE0NywwLjQzNy0wLjM5OVMxNTQuMzE3LDExLjE5NSwxNTQuMDU2LDExLjE5NXoiLz4NCgk8L2c+DQo8L2c+DQo8L3N2Zz4NCg==</value>
</record>

et voilá :smiley:
I've used this converter: SVG to Base64 | Image | Base64 Encode | Base64 Converter | Base64

PS: I think SVG support needs Plone6 coredev buildout ... but maybe works in latest 5.2 too

If you add the logo manually, I think SVG works (I am pretty sure I have done this once)

UPDATE: In Plone 5.2+

Plone Foundation Code of Conduct