Adds docs for creating custom control panel
Fixes #4131 Fixes #1304 See #1882
📚 Documentation preview 📚: https://plone6--1909.org.readthedocs.build/developer-guide/create-control-panel.html
Thanks for submitting your first pull request! You are awesome! :hugs:
If you haven't done so already, read Plone's Code of Conduct and Contribute to documentation, as this will greatly help the review process.
Welcome to the Plone community! :tada:
@plone/classicui-team can I get a review from y'all? This will establish the basis for both Classic UI and Volto.
@sneridagh I couldn't find an example of how to create a control panel in Volto. Does a clear how to guide exist anywhere?
We should include that in this page, or if it exists, add a link to that resource.
@sneridagh I couldn't find an example of how to create a control panel in Volto. Does a clear how to guide exist anywhere?
-> https://training.plone.org/mastering-plone/registry.html#add-a-custom-control-panel @stevepiercy the above link is for addon, but it works the same way for other use cases too!
@rohnsha0 would you please adapt and add that content to this PR? Then developers can go to a single page to add a control panel, regardless of frontend. FTW!
@rohnsha0 I chatted with @sneridagh about this PR, and he said that as long as the control panel uses the basic HTML5 form controls, then they can be mapped to mapped to those in the Storybook. If the control panel does complex things, such as XHR or tabbed interfaces, then that would require significant effort.
@rohnsha0 I chatted with @sneridagh about this PR, and he said that as long as the control panel uses the basic HTML5 form controls, then they can be mapped to mapped to those in the Storybook. If the control panel does complex things, such as XHR or tabbed interfaces, then that would require significant effort.
Is this something for Volto. Right?
@rohnsha0 yes.
@rohnsha0 note that the page contents contains six subheadings, but the manual process introduction contains only four items.
In the current structure, it appears that they are part of the manual process only, but were omitted from the list of items in its introduction.
* [Access your settings in code](https://plone6--1909.org.readthedocs.build/developer-guide/create-control-panel.html#access-your-settings-in-code) * [Register a control panel](https://plone6--1909.org.readthedocs.build/developer-guide/create-control-panel.html#register-a-control-panel)But you are saying that they apply for both the plonecli and manual processes. As such the last two items should have one fewer
#to appear at the correct level.If that is correct, then I would also insert a statement that transitions the reader, and add that to the main introduction as well. I'll add other suggestions in another round of review.
@stevepiercy the registering part is solely for manual procedure as the plonecli already register the configs. However, accessing the code part can be pulled out of the manual process. and ig one # can be removed
@stevepiercy ig now the flow of the article looks much better
I have the feeling this went i bit in the wrong direction. I'll have a more detailed look into it, but for now, just a view points. As far as i know, the control panel created by plonecli should work out of the box in Volto. This is the case for all simple control panels, where the fields are defined in the zope.schema and the default is used. If there is more customization involved like custom templates in classic UI, that's not out of the box, in Volto. But this should not be part of the docs here. Maybe in an advanced chapter, for classic ui and Volto, separately.
Also we have to careful not to duplicate the schema relevant parts here. This is all forms related and forms, schema and fields have there own chapter with details.
@MrTango please also see #1939

