-
-
Notifications
You must be signed in to change notification settings - Fork 176
Adds docs for creating custom control panel #1909 revision #1939
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
base: rohnsha0-control-panel
Are you sure you want to change the base?
Adds docs for creating custom control panel #1909 revision #1939
Conversation
@rohnsha0 one thing that still confuses me are these two headings: Register the control panel viewRegister the control panelWhat's the difference, other than one is in ZCML and the other in XML? |
It register the view (different field in the controlpanel) and once registered can be accessed via given URL directly...
It register the control panel i. e. once registered the control panel appears on the Site Setup screen |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Can be merged into the docs
@rohnsha0 thanks for the explanation. I'll push an update, then merge. |
I'm concerned that $ .venv/bin/plonecli add controlpanel
/Users/stevepiercy/projects/Plone/cookieplone-templates/fluffy/backend/.venv/lib/python3.12/site-packages/case_conversion/case_conversion.py:202: SyntaxWarning: invalid escape sequence '\c'
"""Return text in backslash\case style.
/Users/stevepiercy/projects/Plone/cookieplone-templates/fluffy/backend/.venv/lib/python3.12/site-packages/case_conversion/case_parse.py:28: SyntaxWarning: invalid escape sequence '\p'
upper = regex.compile(u'^[\p{Lu}]$')
/Users/stevepiercy/projects/Plone/cookieplone-templates/fluffy/backend/.venv/lib/python3.12/site-packages/case_conversion/case_parse.py:29: SyntaxWarning: invalid escape sequence '\p'
sep = regex.compile(u'^[^\p{Ll}\p{Lu}\p{Nd}]$')
/Users/stevepiercy/projects/Plone/cookieplone-templates/fluffy/backend/.venv/lib/python3.12/site-packages/case_conversion/case_parse.py:30: SyntaxWarning: invalid escape sequence '\p'
notsep = regex.compile(u'^[\p{Ll}\p{Lu}\p{Nd}]$')
/Users/stevepiercy/projects/Plone/cookieplone-templates/fluffy/backend/.venv/lib/python3.12/site-packages/case_conversion/case_parse.py:97: SyntaxWarning: invalid escape sequence '\p'
valid_acronym = regex.compile(u'^[\p{Ll}\p{Lu}\p{Nd}]+$')
RUN: mrbob bobtemplates.plone:controlpanel
Welcome to mr.bob interactive mode. Before we generate directory structure, some questions need to be answered.
Answer with a question mark to display help.
Values in square brackets at the end of the questions show the default value if there is no answer.
RUN: git status --porcelain --ignore-submodules
git status result:
----------------------------
b'?? docs/project-title/\n?? docs/uv.lock\n?? frontend/pnpm-lock.yaml\n'
--> Please commit your changes, before using a sub-template! Continue anyway? [n/y] [n]: y
--> Name of the Control Panels's Python class? [MyFeaturedControlPanel]:
>>> reading Plone version from bobtemplate.cfg
Traceback (most recent call last):
File "/Users/stevepiercy/projects/Plone/cookieplone-templates/fluffy/backend/.venv/bin/plonecli", line 10, in <module>
sys.exit(cli())
^^^^^
File "/Users/stevepiercy/projects/Plone/cookieplone-templates/fluffy/backend/.venv/lib/python3.12/site-packages/click/core.py", line 1157, in __call__
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/stevepiercy/projects/Plone/cookieplone-templates/fluffy/backend/.venv/lib/python3.12/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/Users/stevepiercy/projects/Plone/cookieplone-templates/fluffy/backend/.venv/lib/python3.12/site-packages/click/core.py", line 1719, in invoke
rv.append(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/stevepiercy/projects/Plone/cookieplone-templates/fluffy/backend/.venv/lib/python3.12/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/stevepiercy/projects/Plone/cookieplone-templates/fluffy/backend/.venv/lib/python3.12/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/stevepiercy/projects/Plone/cookieplone-templates/fluffy/backend/.venv/lib/python3.12/site-packages/click/decorators.py", line 33, in new_func
return f(get_current_context(), *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/stevepiercy/projects/Plone/cookieplone-templates/fluffy/backend/.venv/lib/python3.12/site-packages/plonecli/cli.py", line 128, in add
mrbobmain(mrbob_args)
File "/Users/stevepiercy/projects/Plone/cookieplone-templates/fluffy/backend/.venv/lib/python3.12/site-packages/mrbob/cli.py", line 175, in main
c.render()
File "/Users/stevepiercy/projects/Plone/cookieplone-templates/fluffy/backend/.venv/lib/python3.12/site-packages/mrbob/configurator.py", line 186, in render
render_structure(self.template_dir,
File "/Users/stevepiercy/projects/Plone/cookieplone-templates/fluffy/backend/.venv/lib/python3.12/site-packages/mrbob/rendering.py", line 95, in render_structure
os.mkdir(abs_dir)
FileNotFoundError: [Errno 2] No such file or directory: '/Users/stevepiercy/projects/Plone/cookieplone-templates/fluffy/backend/backend/controlpanels' And @rohnsha0 reported an issue with what I think is buildout in plone/plonecli#87. We might need to rip out |
@rohnsha0 also I don't think we need to use |
@rohnsha0 did you try the |
@stevepiercy it works everytime! What did u do?! If you could list out the seq |
Ah, Sorry. We can add a note a that ploneclli works only with |
it was something which was related to version pinning. it solved the same by adding a explicit version pin but just listed for tracking purpose! |
i somehow made it work with cookieplone somehow but not tested with |
I did exactly what you documented, using a buildout installation. plonecli add controlpanel Resulted in the following console output. Usage: plonecli add [OPTIONS] TEMPLATE
Try 'plonecli add -h' for help.
Error: The "add" command is only allowed within an existing package. See also what I tried for Cookieplone in #1939 (comment). Clearly there are some steps missing. |
the same i am getting too.. |
…cluding usage in non-add-on projects and detailed steps for manual creation.
We also have nothing for Plone 6 Documentation about how to create a Plone add-on for the backend with https://5.docs.plone.org/search.html?q=plonecli&check_keywords=yes&area=default The first four links are duplicates that point the reader to |
PloneCLI's readme gives some info on how to create a addon (it doesnt use the term "backend addon") but it gives a rough idea on how to create it using the tool. |
@rohnsha0 I added a new page that should separate the concerns of creating a backend add-on and creating a control panel. The latter is actually the creation of a subtemplate. This will change the structure of the control panel file once more. |
- Add reference targets and labels
I've pushed this as far as possible. I was not able to get the control panel to load from the steps I wrote up using |
- You've installed Plone for development through either of the following methods. | ||
|
||
- {doc}`/admin-guide/install-buildout` | ||
- {doc}`/admin-guide/install-pip` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- You've installed Plone for development through either of the following methods. | |
- {doc}`/admin-guide/install-buildout` | |
- {doc}`/admin-guide/install-pip` |
we dont need to have Plone installed for creating a backend addon (it is an optional).
plonecli create addon src/collective.myaddon
creates a backend addon, changing the directory and running:
plonecli build
builds the addon which can be run and previewed using
plonecli serve
runs the the plone server using classic ui from the Plone Version defined during creation of addon or the .mrbob global config
additionally, we can integrate the same addon using local.cfg
file in buildouts
…importing the Generic Profile and clarifying buildout steps.
@stevepiercy, I have completed everything from my end and according to me it looks complete! and i have verified everything! and works on my machine... |
There are some updates needed since the recent refactoring of the backend addon template. There's some work in progress in plone/bobtemplates.plone#584 |
Some suggestions:
|
@stevepiercy I'm wondering a bit why this should be in developer guide? |
@MrTango for background and a full explanation, start with PLIP: Plone 7 Documentation Layout, Structure, Theme, and Search to Improve Usability. After reviewing that, if you still have questions, I'm happy to have a call via Discord anytime. I want feedback, especially if it improves and clarifies the PLIP so we're all going in the same direction. Although I targeted Plone 7, I'd love to have it for Plone 6.2 before PloneConf 2025. |
@rohnsha0 please take a look at these revisions. I haven't been able to express myself clearly in a review. I think this PR simplifies its structure and makes it flow better. Please let me know. Thank you!
📚 Documentation preview 📚: