Any easy way to add meta to the header in plone 5

Maybe very different meta in different section of the site, have use seo optimizer for that before plone 5.

There are some options:

  • The best and most flexible way is to register a viewlet for the viewletmanager plone.htmlhead. (See plone.app.layout.viewlets.configure.zcml for example viewlet registrations in plone.htmlhead). That way you can control what to inject quite easily via Python.

  • If the need to add custom metadata arises only where you also have a custom view, you can inject the metadata from within your view template by using

    <metal:block fill-slot="head_slot">
        <meta name="theme-color" content="#ffffff">
    </metal:block>
  • You inject your meta tags via Diazo, using a conditional rule which matches for those conditions, where you want them injected.