plone/plone.app.toolbar — comment on commit 30d6e4d4b34217e63f8fcb2624e24e254430b28d
File:  line 0
By lrowe:

plone.app.cmsui simply sets this in the view (see https://github.com/plone/plone.app.cmsui/blob/master/src/plone/app/cmsui/menu.py#L20). You need some way of signalling that a particular view is part of the UI and should be themed. I think the best way to do this might be to add an interface to the views that are part of the UI to signal that they should not be themed. This can be done from a simple ZCML directive externally to the view itself. An IPubAfterTraversal event can then set the header and changeSkin.

I don't think you can do this with an IBeforeTraverseEvent as you don't know at that point whether the view you are rendering should be themed or not.