Adding Theme Base Options

After creating a diazo-based theme package via mr.bob in Plone 5, it is enabled and working. With my experience in Plone 4.3 days, I expect a default theme (like Sunburst or Barceloneta) to be set as theme base. However, I can only see (Unstyled) from the dropdown menu. I am not sure if this is an intentional design, but I think more UI-friendly with Sunburst or Barceloneta as theme base. I do try install Sunburst in Plone 5 but fail. Or if possible, I'd love to use Barceloneta as my theme base. Any suggestion?

You are out of luck!

Basically, what you are trying to do is this:
http://docs.plone.org/adapt-and-extend/theming/barceloneta.html#inheriting-a-new-theme-from-barceloneta

This is intentional. The point is to provide a nice clean base that is easy to style with your themes.

That setting is unnecessary in Plone 5 from my experience thankfully. Plone 5 gives nice clean html markup for your diazo theme to style.

Thank you, @JotaMG @espenmn @vangheem for the useful info. I do try barceloneta only for the backend as the documentation says. At least this updates my knowledge about Diazo theming with Plone 5. Though unnecessary, still I wonder, if technically I can add options for Theme Base, what steps should I follow to achieve?

We need to update bobtemplates.plone to include this. Thanks for pointing it out, I opened an issue.

In the meantime you need to do it yourself. Basically you need to register a resource and a bundle for your package, in the file profile/default/registry.xml, and that resource will reference a copy of barceloneta.plone.less that you'll add in your package's theme/less folder. You need a copy because in the end of the file you'll add imports to your custom LESS/CSS.

Also you'll need to edit your existing profile/default/metadata.xml to register all Barceloneta resources (JS and CSS) as proper entries in Site Setup > Resource Registries. That is needed so you can reference those later in your new main.less.

It's a bit of indirection but the good news is that you'll be able to turn off specific parts of Barceloneta that may not be useful to your theme.

You can read more about it in https://training.plone.org/5/theming/theme-package.html#css-and-js-resources Let us know if you get stuck.

1 Like