Skip to content

Commit 2645edd

Browse files
committed
Add chapter about backend add-ons to admin guide
1 parent 323429e commit 2645edd

File tree

2 files changed

+201
-0
lines changed

2 files changed

+201
-0
lines changed

docs/admin-guide/add-ons.md

Lines changed: 200 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,200 @@
1+
---
2+
myst:
3+
html_meta:
4+
"description": "Install Plone Add-ons"
5+
"property=og:description": "Install Plone Add-ons"
6+
"property=og:title": "Install Plone Add-ons"
7+
"keywords": "Plone 6, addon, add-on, package, plugin, extension, install"
8+
---
9+
10+
(install-plone-addons-label)=
11+
12+
# Install Plone Add-ons
13+
14+
This chapter explains how to install {term}`add-ons <Add-on>` as Python packages to extend the functionality of the Plone backend or Classic UI.
15+
16+
```{note}
17+
The Volto frontend has its own system of add-ons using Node.js packages. See {doc}`/volto/addons/index`.
18+
```
19+
20+
## with Cookieplone
21+
22+
Use the following instructions if you installed Plone with Cookieplone or `cookiecutter-plone-starter`.
23+
24+
### Install an add-on
25+
26+
Add a line with the name of your add-on in `backend/requirements.txt`.
27+
This example uses [`collective.easyform`](https://pypi.org/project/collective.easyform/).
28+
29+
```
30+
collective.easyform==4.2.1
31+
```
32+
33+
```{tip}
34+
Including the add-on version ensures that it won't accidentally get upgraded in the future.
35+
```
36+
37+
Also add the add-on to `zcml_package_includes` in {file}`backend/instance.yaml` to make sure its configuration will be loaded:
38+
39+
```yaml
40+
default_context:
41+
zcml_package_includes: project_title, collective.easyform
42+
```
43+
44+
Stop the backend with {kbd}`ctrl-c`.
45+
46+
To actually download and install the new add-on, run:
47+
48+
```shell
49+
make backend-build
50+
```
51+
52+
```{note}
53+
If you installed Plone using `cookiecutter-plone-starter`, run `make build-backend` instead.`
54+
```
55+
56+
Now restart the backend.
57+
58+
In your web browser, and assuming you are currently logged in as `admin`, visit the URL http://localhost:8080/Plone/prefs_install_products_form.
59+
60+
Then click the {guilabel}`Install` button next to your add-on to complete installation of the add-on.
61+
62+
Some add-ons have configuration options.
63+
To configure such add-ons, return to the {guilabel}`Site Setup` control panel.
64+
At the bottom of the page, you should see the heading {guilabel}`Add-on Configuration`, and a control panel to configure the add-on that you just installed.
65+
66+
67+
### Install an add-on from source
68+
69+
An add-on can be installed from a source control system such as GitHub.
70+
71+
Add a line with the name of your add-on in `backend/requirements.txt`.
72+
This example uses [`collective.easyform`](https://pypi.org/project/collective.easyform/).
73+
74+
```
75+
collective.easyform
76+
```
77+
78+
```{note}
79+
When installing an add-on from source, it's best to not pin a version, to make sure we use the version that's currently available in the source control system.
80+
```
81+
82+
Also add the add-on to `zcml_package_includes` in {file}`backend/instance.yaml` to make sure its configuration will be loaded:
83+
84+
```yaml
85+
default_context:
86+
zcml_package_includes: project_title, collective.easyform
87+
```
88+
89+
Finally, add the package's source to {file}`mx.ini`:
90+
91+
```cfg
92+
[collective.easyform]
93+
url=git@github.com:collective/collective.easyform.git
94+
branch=dev-branch-name
95+
extras=test
96+
```
97+
98+
```{seealso}
99+
The {file}`mx.ini` file configures a tool called {term}`mxdev`.
100+
See the [documentation of `mxdev` in its README.md](https://github.com/mxstack/mxdev/blob/main/README.md) for complete information.
101+
```
102+
103+
Stop the backend with {kbd}`ctrl-c`.
104+
105+
To actually download and install the new add-on, run:
106+
107+
```shell
108+
make backend-build
109+
```
110+
111+
```{note}
112+
If you installed Plone using `cookiecutter-plone-starter`, run `make build-backend` instead.`
113+
```
114+
115+
Now restart the backend.
116+
117+
In your web browser, and assuming you are currently logged in as `admin`, visit the URL http://localhost:8080/Plone/prefs_install_products_form.
118+
An upgrade step might need to be performed in the Plone control panel.
119+
Follow the upgrade information, if present.
120+
Else click the {guilabel}`Install` button to complete installation of the add-on.
121+
122+
123+
## with Buildout
124+
125+
Use the following instructions if you installed Plone with Buildout.
126+
127+
### Install an add-on
128+
129+
Update {file}`buildout.cfg`.
130+
This example uses [`collective.easyform`](https://pypi.org/project/collective.easyform/).
131+
132+
```cfg
133+
[buildout]
134+
extends =
135+
https://dist.plone.org/release/6-latest/versions.cfg
136+
137+
parts =
138+
instance
139+
140+
[instance]
141+
recipe = plone.recipe.zope2instance
142+
user = admin:admin
143+
http-address = 8080
144+
eggs =
145+
Plone
146+
collective.easyform
147+
148+
[versions]
149+
collective.easyform = 4.2.1
150+
```
151+
152+
```{tip}
153+
Including the add-on version ensures that it won't accidentally get upgraded in the future.
154+
```
155+
156+
To actually download and install the new add-on, run:
157+
158+
```shell
159+
bin/buildout
160+
```
161+
162+
### Install an add-on from source
163+
164+
An add-on can be installed from a source control system such as GitHub.
165+
166+
Update {file}`buildout.cfg`.
167+
This example uses [`collective.easyform`](https://pypi.org/project/collective.easyform/).
168+
169+
```cfg
170+
[buildout]
171+
extends =
172+
https://dist.plone.org/release/6-latest/versions.cfg
173+
extensions = mr.developer
174+
auto-checkout =
175+
collective.easyform
176+
177+
parts =
178+
instance
179+
180+
[instance]
181+
recipe = plone.recipe.zope2instance
182+
user = admin:admin
183+
http-address = 8080
184+
eggs =
185+
Plone
186+
collective.easyform
187+
188+
[sources]
189+
collective.easyform = git https://github.com/collective/collective.easyform.git
190+
```
191+
192+
To actually download and install the new add-on, run:
193+
194+
```shell
195+
bin/buildout
196+
```
197+
198+
```{seealso}
199+
This approach uses the [`mr.developer`](https://pypi.org/project/mr.developer/) Buildout extension.
200+
```

docs/admin-guide/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ install-plonestarter
2929
:maxdepth: 1
3030
3131
run-plone
32+
add-ons
3233
upgrade
3334
```
3435

0 commit comments

Comments
 (0)