Skip to content

Adds docs for creating custom control panel #1909

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 20 commits into
base: 6.0
Choose a base branch
from

Conversation

rohnsha0
Copy link

@rohnsha0 rohnsha0 commented Mar 14, 2025

@rohnsha0 rohnsha0 requested a review from stevepiercy March 14, 2025 04:07
Copy link

boring-cyborg bot commented Mar 14, 2025

Thanks for submitting your first pull request! You are awesome! 🤗

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! 🎉

- Sentence case headings
- Add content to empty headings
- Use appropriate list type, either bulleted or definition
- Indent lists 4 spaces for consistency and visually spotting syntax issues
- Use `{file}` markup for files, directories, and file paths
- Emphasize lines in code block as needed
Copy link
Contributor

@stevepiercy stevepiercy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I completed my review by making thoroughly commented commits.

I have a couple of questions for clarification.

This also needs a technical peer review before getting merged.

Thank you for pulling all the pieces together. This is awesome.

@stevepiercy
Copy link
Contributor

@plone/classicui-team can I get a review from y'all? This will establish the basis for both Classic UI and Volto.

@stevepiercy stevepiercy mentioned this pull request Mar 15, 2025
40 tasks
@stevepiercy stevepiercy added this to the Plone 6.1 milestone Mar 15, 2025
@stevepiercy
Copy link
Contributor

@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.

@rohnsha0
Copy link
Author

@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!

@stevepiercy
Copy link
Contributor

@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!

@stevepiercy
Copy link
Contributor

@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
Copy link
Author

@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?

@stevepiercy
Copy link
Contributor

@rohnsha0 yes.

Copy link
Contributor

@stevepiercy stevepiercy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few changes based on response.

```


## Use `FieldSet` to group fields
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this also part of the manual process only or both manual and plonecli?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stevepiercy this needs to be added in any way you use to create the controlpanel, as these include the fields (to be grouped) that needs to be shown in the settings (of the controlpanel)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, please see other comments regarding the flow and structure of this chapter. I think we're close to finished with those enhancements.

rohnsha0 and others added 2 commits April 6, 2025 19:42
Copy link
Contributor

@stevepiercy stevepiercy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rohnsha0 note that the page contents contains six subheadings, but the manual process introduction contains only four items.

Screenshot 2025-04-06 at 12 43 21 PM

Screenshot 2025-04-06 at 12 44 28 PM

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.

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.

```


## Use `FieldSet` to group fields
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, please see other comments regarding the flow and structure of this chapter. I think we're close to finished with those enhancements.

@rohnsha0 rohnsha0 requested a review from stevepiercy April 15, 2025 18:00
Copy link
Contributor

@stevepiercy stevepiercy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These comments remain unresolved and need to be addressed before merging. The content is good and ready, but its flow between sections could use some improvement. Thank you!

@rohnsha0
Copy link
Author

@rohnsha0 note that the page contents contains six subheadings, but the manual process introduction contains only four items.

Screenshot 2025-04-06 at 12 43 21 PM

Screenshot 2025-04-06 at 12 44 28 PM

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

@rohnsha0
Copy link
Author

@stevepiercy ig now the flow of the article looks much better

@MrTango
Copy link
Contributor

MrTango commented Apr 18, 2025

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 MrTango self-requested a review April 18, 2025 14:44
@rohnsha0
Copy link
Author

@MrTango please also see #1939

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

How to create a control panel in Plone Create Control Panel needs content
3 participants