Switch off Diazo?

We're using Mosaic with site layouts. Thus we do not need Diazo transforms. Is there some way to switch off Diazo?

At the moment we use an empty transform, copying over all <html> attributes and children into an almost empty theme (just <html><body></body></html> (body is needed, because otherwise plone.protect fails). This works but is a minimal overhead.

1 Like

You could mark all requests with the X-Theme-Disabled header, but you'd be exchanging processing & code complexity with (a small?) network overhead.

1 Like

Hi Jens,

There's several ways you could do this, I think.

  1. Provide your own theme policy and make isThemeEnabled return False:
    https://github.com/plone/plone.app.theming/blob/master/src/plone/app/theming/utils.py#L47
  2. Override or disable the transform:
    https://github.com/plone/plone.app.theming/blob/master/src/plone/app/theming/transform.py#L27
  3. Override/nullify the theme settings, which will make the transform do nothing
  4. Monkey patch transformIterable to return the arguments directly:
    https://github.com/plone/plone.app.theming/blob/master/src/plone/app/theming/transform.py#L115

This is in order of my preference :wink:

2 Likes

thanks for the suggestions. In fact I want the theme to be enabled (I need other features here), just the transform to be disabled. My ideal would be to not have any rules.xml oder theme.html. Thanks for the pointers, I'll dig deeper there.