How to override view/template of a default content type (e.g. Document) with zcml? Since I need some logic and want to be explicit jbot is not suitable. Registering a new view as described in docs works like a charm.
I tried to register my view under the same name "document_view" using a custom layer:
Where the template document.pt and the class inside .views are located where configure is. Probably you will also need to make your layer inherite from: IPloneAppContenttypesLayer so your layer has more priority, like this:
from plone.app.contenttypes.interfaces import IPloneAppContenttypesLayer
class IPlonethemeMythemeLayer(IDefaultBrowserLayer, IPloneAppContenttypesLayer):
"""Marker interface that defines a browser layer.
"""
Other option is to register a view with a different name and change the default view of the Document