Skip to content
Open
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
091a89a
Add Create a backend add-on section in the Developer guide.
stevepiercy Nov 6, 2024
a766f5a
- Update meta information
stevepiercy Nov 6, 2024
d8e135c
Merge branch '6.0' into dev-guide-create-a-backend-add-on
stevepiercy Nov 6, 2024
ed9c4af
Merge branch '6.0' into dev-guide-create-a-backend-add-on
stevepiercy Nov 8, 2024
13b85f7
Merge branch '6.0' into dev-guide-create-a-backend-add-on
stevepiercy Nov 18, 2024
0f7a455
Merge branch '6.0' into dev-guide-create-a-backend-add-on
stevepiercy Nov 19, 2024
7767c8b
Merge branch '6.0' into dev-guide-create-a-backend-add-on
stevepiercy Dec 5, 2024
9d9994f
Merge branch '6.0' into dev-guide-create-a-backend-add-on
stevepiercy Feb 9, 2025
3119199
Merge branch '6.0' into dev-guide-create-a-backend-add-on
stevepiercy Feb 26, 2025
dcc8b32
Merge branch '6.0' into dev-guide-create-a-backend-add-on
petschki Nov 25, 2025
67b1ee7
create backend addon documentation
petschki Nov 25, 2025
0cad2b0
create genericsetup documentation
petschki Nov 25, 2025
042ff32
remove note
petschki Nov 25, 2025
aad7b71
Use file markup
stevepiercy Nov 26, 2025
df7340f
Revert changes in i18n and glossary to keep PR focused on GenericSetup
stevepiercy Nov 27, 2025
6af80fc
Revert changes in i18n and glossary to keep PR focused on GenericSetup
stevepiercy Nov 27, 2025
8579a16
Merge branch '6.0' into dev-guide-create-a-backend-add-on
stevepiercy Dec 1, 2025
2675e11
Update docs/developer-guide/create-a-backend-add-on.md
petschki Dec 1, 2025
6e92377
remove plonecli addon creation and note for monorepo "make" command
petschki Dec 1, 2025
0a4cace
only mention "make" command for "cookieplone" generated addons
petschki Dec 1, 2025
132f1be
Update docs/developer-guide/create-a-backend-add-on.md
petschki Dec 9, 2025
2fe88be
Merge branch '6.0' into dev-guide-create-a-backend-add-on
MrTango Jan 14, 2026
bb795bc
explain how to create a backend-addon with plonecli only.
petschki Jan 15, 2026
3db83f5
minor command fix
petschki Jan 15, 2026
a7b0d43
Merge branch '6.0' into dev-guide-create-a-backend-add-on
stevepiercy Feb 9, 2026
096109d
Begin editorial clean up
stevepiercy Feb 9, 2026
a0358f1
Merge branch '6.0' into dev-guide-create-a-backend-add-on
petschki Feb 20, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
create backend addon documentation
  • Loading branch information
petschki committed Nov 25, 2025
commit 67b1ee7bad442473eedffc1f7bd0b152acadab9d
220 changes: 215 additions & 5 deletions docs/developer-guide/create-a-backend-add-on.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,220 @@ myst:
# Create a backend add-on

This section explains how a developer can create an {term}`add-on` for the Plone backend.
You will use a framework called {term}`GenericSetup` and a tool called {term}`Buildout`.

```{note}
This section for Plone 6 is in the process of being written.
Until it is complete, Plone 5 documentation is the authoritative source.
{doc}`plone5:develop/addons/components/genericsetup` (Plone 5)
## System requirements

Follow the section {ref}`create-project-cookieplone-system-requirements` to set up your system.

## Generate the add-on project with `cookieplone`

To develop an add-on for backend and/or Classic-UI, run the following command to generate your add-on project using the `backend_addon` Cookieplone template.
See {doc}`plone:install/create-project-cookieplone` for details of the latter scenario.
The following output assumes the former scenario.

```shell
uvx cookieplone backend_addon
```

```console
> uvx cookieplone backend_addon
╭──────────────────────────────── cookieplone ─────────────────────────────────╮
│ │
│ ******* │
│ *************** │
│ *** *** │
│ *** *** *** │
│ *** ***** *** │
│ *** *** *** │
│ *** *** *** │
│ *** ***** *** │
│ *** *** *** *** │
│ *** ***** *** │
│ *** *** *** │
│ *** *** │
│ *************** │
│ ******* │
│ │
╰──────────────────────────────────────────────────────────────────────────────╯
You've downloaded /Users/<username>/.cookiecutters/cookieplone-templates before. Is
it okay to delete and re-download it? [y/n] (y):
╭──────────────────────────────── Plone Addon ─────────────────────────────────╮
│ │
│ Creating a new Plone Addon │
│ │
│ Sanity check results: │
│ │
│ - Cookieplone: ✓ │
│ - uv: ✓ │
│ - git: ✓ │
│ │
╰──────────────────────────────────────────────────────────────────────────────╯
[1/10] Addon Title (Addon):
[2/10] A short description of your addon (A new addon for Plone):
[3/10] Author (Plone Community):
[4/10] Author E-mail (collective@plone.org):
[5/10] GitHub Username or Organization (collective):
[6/10] Should we use prerelease versions? (No):
[7/10] Plone Version (6.1.3):
[8/10] Python package name (collective.addon):
[9/10] Support headless Plone?
1 - Yes
2 - No
Choose from [1/2] (1):
[10/10] Would you like to add a documentation scaffold to your project?
1 - Yes
2 - No
Choose from [1/2] (1):
-> Remove files used in classic UI setup
-> Create namespace packages
-> Format code
-> Initialize Git repository
-> Generate documentation scaffold
╭────────────────────────── New addon was generated ───────────────────────────╮
│ │
│ Addon │
│ │
│ Now, enter the repository, start coding, and push to your organization. │
│ │
│ Sorry for the convenience, │
│ The Plone Community. │
│ │
│ https://plone.org/ │
╰──────────────────────────────────────────────────────────────────────────────╯
```

Cookieplone creates a folder with the name of the add-on, in this example, `collective.addon`.

You can now continue to add subtemplates to your addon {ref}`create-a-backend-add-on-add-subtemplate-label`


## Generate the add-on project with `plonecli`

Run the following command to create an addon project with `plonecli`

```shell
uvx plonecli create addon <addon namespace package>
```

```console
> uvx plonecli create addon collective.addon
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I tried this and here's what happened:

$ uvx plonecli create addon collective.addon
Traceback (most recent call last):
  File "/Users/davisagli/.local/share/uv/tools/plonecli/bin/plonecli", line 4, in <module>
    from plonecli.cli import cli
  File "/Users/davisagli/.local/share/uv/tools/plonecli/lib/python3.14/site-packages/plonecli/__init__.py", line 4, in <module>
    import pkg_resources
ModuleNotFoundError: No module named 'pkg_resources'
  • uv picked the latest Python it knows about, which is 3.14. Does plonecli support it?
  • it got the new version of setuptools which doesn't have pkg_resources

It looks like @erral already fixed the latter in plone/plonecli@a00e960 ... could that be released?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yes sorry, I didn't find time to request releases of all of them (mrbob, plonecli, bobtemplates.plone). I'll do it later today.

RUN: bobtemplates.plone:addon -O collective.addon

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.


--> Package description [An add-on for Plone]:

--> Plone version [6.0.0]:

--> Python version for virtualenv [python3]:

--> Do you want me to activate VS Code support? (y/n) [y]:



isort-apply: successful:
isort-apply: install_deps> python -I -m pip install isort -c constraints.txt
isort-apply: commands[0]> isort /Users/<username>/Development/collective.addon/src
/Users/<username>/Development/collective.addon/setup.py
Fixing /Users/<username>/Development/collective.addon/src/collective/addon/testing.py
Fixing /Users/<username>/Development/collective.addon/src/collective/addon/tests/test_setup.py
isort-apply: OK (2.57=setup[1.94]+cmd[0.63] seconds)
congratulations :) (2.59 seconds)


Identified `/` as project root containing a file system root.
Sources to be formatted: "Users/<username>/Development/collective.addon/src",
"Users/<username>/Development/collective.addon/setup.py"
src/collective/__init__.py wasn't modified on disk since last run.
src/collective/addon/browser/__init__.py wasn't modified on disk since last run.
src/collective/addon/locales/__init__.py wasn't modified on disk since last run.
src/collective/addon/tests/__init__.py wasn't modified on disk since last run.
src/collective/addon/interfaces.py already well formatted, good job.
reformatted src/collective/addon/__init__.py
reformatted src/collective/addon/setuphandlers.py
reformatted src/collective/addon/testing.py
reformatted setup.py
reformatted src/collective/addon/locales/update.py
reformatted src/collective/addon/tests/test_setup.py

All done! ✨ 🍰 ✨
6 files reformatted, 5 files left unchanged.

black-enforce: successful:
black-enforce: install_deps> python -I -m pip install black -c constraints.txt
black-enforce: commands[0]> black -v src setup.py
black-enforce: OK (2.60=setup[2.12]+cmd[0.48] seconds)
congratulations :) (2.61 seconds)


git init is disabled!
Generated file structure at /Users/<username>/Development/collective.addon/collective.addon
```

Plonecli creates a folder with the name of the add-on, in this example, `collective.addon`.

You can now continue to add subtemplates to your addon {ref}`create-a-backend-add-on-add-subtemplate-label`


(create-a-backend-add-on-add-subtemplate-label)=

## Add `plonecli` subtemplate to an addon

The generated addon contains a {file}`bobtemplates.cfg` file which lets you add several subtemplates with `plonecli`.

Run the following command to list the available subtemplates.

```shell
uvx plonecli -l
```

```shell
> uvx plonecli -l
Available mr.bob templates:
- addon
- behavior
- content_type
- controlpanel
- form
- indexer
- mockup_pattern
- portlet
- restapi_service
- site_initialization
- subscriber
- svelte_app
- theme
- theme_barceloneta
- theme_basic
- upgrade_step
- view
- viewlet
- vocabulary
- buildout
```

All templates below `addon` can be added to your newly created addon with:

```shell
uvx ploncli add <subtemplate>
```

Currently documented subtemplates:

- behavior: {ref}`backend-behaviors-label`
- content_type: {ref}`creating-content-types-label`
- controlpanel: {ref}`control-panels-label`
- form: {reg}`forms-label`
- mockup_pattern: {ref}`mockup-and-patternslib-label`
- theme_barceloneta: {ref}`create-a-theme-add-on-label`


The addon also contains a {term}`GenericSetup` default install/uninstall profile.

See {ref}`genericsetup-label` for more information.