Using variable in manifest

Is there a way i can use a variable in manifest.cfg to 'define the less file ?

I want to read the less file from:
development-css = /++theme++multitheme/less/${themefile}.less

Where themefile is:
python:context.portal_registry['collective.multitheme.interfaces.IThemeSettings.colorpalette']

It won't answer your question, but take a look at http://spiritplonetheming.readthedocs.io/en/latest/, it has a different approach.

And an example for a diazo rule for color options is here: http://spiritplonetheming.readthedocs.io/en/latest/diazo.html#color-option

Actually, that is the approach that I am using at the moment, ... it works (but not for TinyMCE). It just feels 'wrong' to do it this way...

https://github.com/espenmn/medialog.bergensiana/blob/master/medialog/bergensiana/theme/rules.xml#L31-L33

I don't think it's wrong. And it's currently the only way how to build a multi-option theme. (I just don't like the [theme:parameters] approach since users can destroy a theme when used wrong.)

And yes, the theming settings for TinyMCE only allow one CSS file to be set. My customers are fine with the following:

  • Theme for the frontend, Barceloneta for the backend
  • Base theme CSS for TinyMCE (so structures are visible)
  • Additional color for frontend

The only current alternative is to have your CSS rendered from a view which then takes your color choices into account.

Is there another way of setting this option (not define it in manifest.cfg)?
Where 'does TinyMCE get the css from' ?
Can I set it in the registry or can I somehow make a diazo rule that loads a CSS?

Ha, based on https://github.com/plone/Products.CMFPlone/blob/master/Products/CMFPlone/patterns/tinymce.py#L50 it seems to be possible to set multiple files for the TinyMCE CSS. It is then used at https://github.com/plone/Products.CMFPlone/blob/master/Products/CMFPlone/patterns/tinymce.py#L123 to generate the configuration for TinyMCE.

If (in manifest file)

color1 = python:context.portal_registry['collective.multitheme.interfaces.ICollectiveMultiThemeSettings.color1']

Is it somewhat possible to use that 'in html', like this:

<after theme-children="/html/head" >
   <style>
       .custom-color1 { color: $color1 }
 </style>

PS: This syntax is not working