Skip to content

Commit c99c8d4

Browse files
committed
improve layers docs
1 parent d6be714 commit c99c8d4

File tree

1 file changed

+1
-47
lines changed

1 file changed

+1
-47
lines changed

docs/classic-ui/layers.md

Lines changed: 1 addition & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -58,54 +58,8 @@ Then views and viewlets from your product can be enabled on the site instance us
5858
### Unconditional overrides
5959

6060
If you want to override a view or a viewlet unconditionally for all sites without the add-on product installer support, you need to use `overrides.zcml`.
61-
You can override classes and templates in this file.
61+
You can override classes and templates in this file. To do this, you put the ZCML-registration in a files called overrides.zcml in the package root (next to the top most configure.zcml).
6262

63-
Overide a class:
64-
65-
```xml
66-
<browser:viewlet
67-
name="plone.site_actions"
68-
manager="plone.app.layout.viewlets.interfaces.IPortalHeader"
69-
class=".yourViewlet.YourClassViewlet"
70-
permission="zope2.View"
71-
layer="your.app.interfaces.IYourAppLayer"
72-
/>
73-
```
74-
75-
Overide a template:
76-
77-
```xml
78-
<browser:viewlet
79-
name="plone.logo"
80-
for="*"
81-
template="your-logo.pt"
82-
permission="zope2.View"
83-
layer="your.app.interfaces.IYourAppLayer"
84-
/>
85-
```
86-
You can combine both as well. For example, you can override a class and use a different template for it:
87-
88-
```xml
89-
<browser:viewlet
90-
name="plone.site_actions"
91-
manager="plone.app.layout.viewlets.interfaces.IPortalHeader"
92-
class=".yourViewlet.YourClassViewlet"
93-
template="your-logo.pt"
94-
permission="zope2.View"
95-
layer="your.app.interfaces.IYourAppLayer"
96-
/>
97-
```
98-
99-
If you want to override a viewlet or view of a specific add-on product, you need to use enheritance the Layer interface of the add-on product into your own Layer interface.
100-
For example, if you want to override the `sidebar` viewlet of the `collective.sidebar` add-on product, you need to create a new Layer interface and inherit from the `collective.sidebar` Layer interface.
101-
102-
```python
103-
from collective.sidebar.interfaces import ICollectiveSidebarLayer
104-
105-
class IYourAppLayer(ICollectiveSidebarLayer):
106-
"""Marker interface that defines a browser layer."""
107-
108-
```
10963

11064
(classic-ui-creating-a-layer-label)=
11165

0 commit comments

Comments
 (0)