You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To manually register a view as a control panel, add the following registration to your {file}`/profiles/default/controlpanel.xml`.
198
198
@@ -323,9 +323,10 @@ mypackage/
323
323
324
324
## REST API compatible control panels
325
325
326
-
For better integration between backend and Volto, you can create REST API compatible control panels using the adapter pattern. This approach is particularly useful when developing control panels that need to work seamlessly with Volto.
326
+
For better integration between backend and Volto, you can create REST API compatible control panels using the adapter pattern.
327
+
This approach is particularly useful when developing control panels that need to work seamlessly with Volto.
327
328
328
-
Create a Python module like `mypackage/controlpanel.py`:
329
+
Create a Python module {file}`mypackage/controlpanel.py` as follows.
329
330
330
331
```python
331
332
from plone.restapi.controlpanels import RegistryConfigletPanel
"""Volto-compatible REST API control panel for my addon settings."""
341
+
"""Volto-compatible REST API control panel for my add-on settings."""
341
342
342
343
schema = IMyControlPanelSettings
343
344
schema_prefix ="my.addon"
@@ -347,7 +348,7 @@ class MyAddonControlPanel(RegistryConfigletPanel):
347
348
group ="General"
348
349
```
349
350
350
-
Then register the adapter in your ZCML configuration file:
351
+
Then register the adapter in your ZCML configuration file.
351
352
352
353
```xml
353
354
<!-- mypackage/configure.zcml or mypackage/controlpanel/configure.zcml -->
@@ -363,16 +364,26 @@ Then register the adapter in your ZCML configuration file:
363
364
</configure>
364
365
```
365
366
366
-
The `group` property in the control panel class corresponds to the control panel category in Volto:
367
-
-`General`: General settings (corresponds to `plone-general`)
368
-
-`Content`: Content-related settings (corresponds to `plone-content`)
369
-
-`Users`: Users and groups settings (corresponds to `plone-users`)
370
-
-`Security`: Security settings (corresponds to `plone-security`)
371
-
-`Advanced`: Advanced settings (corresponds to `plone-advanced`)
367
+
The `group` property in the control panel class corresponds to the control panel category in Volto.
368
+
369
+
`General`
370
+
: General settings (corresponds to `plone-general`)
371
+
372
+
`Content`
373
+
: Content-related settings (corresponds to `plone-content`)
374
+
375
+
`Users`
376
+
: Users and groups settings (corresponds to `plone-users`)
377
+
378
+
`Security`
379
+
: Security settings (corresponds to `plone-security`)
380
+
381
+
`Advanced`
382
+
: Advanced settings (corresponds to `plone-advanced`)
372
383
373
384
With this approach, your control panel will be automatically available through the REST API at the endpoint `@controlpanels/my-controlpanel`, making it easy to integrate with Volto without additional configuration.
374
385
375
-
You will still need to set up the registry.xml with default values as described earlier.
386
+
You will still need to set up {file}`registry.xml` with default values as described earlier.
376
387
377
388
```{seealso}
378
389
See the chapter {ref}`training:controlpanel-label` from the Mastering Plone 6 Training.
0 commit comments