Skip to content

Commit baad68c

Browse files
authored
Merge pull request plone#1208 from plone/controlpanels
add contropanels section
2 parents 50662c0 + ad97c11 commit baad68c

File tree

2 files changed

+45
-1
lines changed

2 files changed

+45
-1
lines changed

docs/backend/control-panels.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
html_meta:
3+
"description": "How to add a Control Panel"
4+
"property=og:description": "How to add a Control Panel"
5+
"property=og:title": "Control panels"
6+
"keywords": "Plone, Add, Control Panel"
7+
---
8+
9+
(backend-controlpanels-label)=
10+
11+
# Control panels
12+
13+
## Adding a control panel
14+
To add a control panel to your add-on, you can use [`plonecli`](https://pypi.org/project/plonecli/) as follows:
15+
16+
```shell
17+
plonecli add controlpanel
18+
```
19+
20+
This will create the control panel Python file in the control panel's folder where you can define your control panel schema fields.
21+
22+
## Registering a Control panel
23+
To manually register a view as a control panel, add the following registration to your `/profiles/default/controlpanel.xml`.
24+
25+
```xml
26+
<?xml version="1.0"?>
27+
<object
28+
name="portal_control-panel"
29+
xmlns:i18n="http://xml.zope.org/namespaces/i18n"
30+
i18n:domain="lmu.behavior">
31+
<configlet
32+
title="Some Control Panel"
33+
action_id="collective.example.some_control-panel"
34+
appId="collective.example"
35+
category="Products"
36+
condition_expr=""
37+
url_expr="string:${portal_url}/@@some_view"
38+
icon_expr=""
39+
visible="True"
40+
i18n:attributes="title">
41+
<permission>Manage portal</permission>
42+
</configlet>
43+
</object>
44+
```

docs/backend/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ html_meta:
1212

1313
```{toctree}
1414
:maxdepth: 2
15-
15+
control-panels
1616
content-types
1717
behaviors
1818
annotations

0 commit comments

Comments
 (0)