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:
  2. Override or disable the transform:
  3. Override/nullify the theme settings, which will make the transform do nothing
  4. Monkey patch transformIterable to return the arguments directly:

This is in order of my preference :wink:


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.