You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/admin-guide/add-ons.md
+61-34Lines changed: 61 additions & 34 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,11 +18,15 @@ The Volto frontend has its own system of add-ons using Node.js packages.
18
18
See {doc}`/volto/development/add-ons/index`.
19
19
```
20
20
21
+
(install-an-add-on-from-pypi-label)=
22
+
21
23
## Install an add-on from PyPI
22
24
23
25
This section describes how to install an add-on that is released on {term}`PyPI`.
24
26
25
27
28
+
(configure-add-on-installation-pypi-label)=
29
+
26
30
### Configure add-on installation
27
31
28
32
First, configure your project according to the instructions in the tabbed interface below.
@@ -89,6 +93,9 @@ You can control which version of an add-on to install through "version pinning."
89
93
- Leave it off to always install the latest version.
90
94
```
91
95
96
+
97
+
(install-the-add-on-pypi-label)=
98
+
92
99
### Install the add-on
93
100
94
101
Stop the backend with {kbd}`ctrl-c`.
@@ -113,7 +120,7 @@ bin/buildout -N
113
120
````
114
121
`````
115
122
116
-
Finally, restart the backend.
123
+
Next, restart the backend.
117
124
118
125
```{seealso}
119
126
{doc}`run-plone`
@@ -130,18 +137,26 @@ At the bottom of the page, you should see the heading {guilabel}`Add-on Configur
130
137
131
138
## Install an add-on from source
132
139
133
-
An unreleased add-on can be installed from a source control system such as GitHub.
140
+
This section describes how to install an unreleased add-on from a source control system, such as GitHub.
141
+
134
142
135
-
For instructions to install an add-on that is released on {term}`PyPI`, select the tab below according to your Python package manager.
143
+
(configure-add-on-installation-source-label)=
144
+
145
+
### Configure add-on installation
146
+
147
+
First, configure your project according to the instructions in the tabbed interface below.
148
+
Select the tab according to your Python package manager.
136
149
137
150
```{tip}
138
-
Select the tab for uv if you have a project that was created using Cookieplone, and you have `managed = true` set in the `[tool.uv]` section of the file {file}`backend/pyproject.toml`.
139
-
Select the tab for pip if you have a project that was created using Cookieplone that does not have this setting.
151
+
For projects created with Cookieplone, select either the tab labeled:
152
+
153
+
- {guilabel}`uv` if the file {file}`backend/pyproject.toml`, under the table `[tool.uv]` has the setting of `managed = true`
154
+
- {guilabel}`pip` if your project doesn't have this setting
140
155
```
141
156
142
157
`````{tab-set}
143
-
144
158
````{tab-item} uv
159
+
:sync: uv
145
160
146
161
Clone the repository into a local directory.
147
162
This example uses [`collective.easyform`](https://pypi.org/project/collective.easyform/).
@@ -157,22 +172,16 @@ cd backend
157
172
uv add --editable ../collective.easyform
158
173
```
159
174
160
-
```{note}
161
-
When installing an add-on from source, it's best not to pin a version.
162
-
This way you always get the version that's currently available in the source control system.
163
-
```
164
-
165
-
Next add the add-on to `zcml_package_includes` in the file {file}`backend/instance.yaml` so that its configuration will load.
175
+
To configure the add-on to load, in the file {file}`backend/instance.yaml`, under the key `default_context`, for the key `zcml_package_includes`, set its value to the add-on's name.
Add the name of your add-on in the file {file}`backend/pyproject.toml` in the section `dependencies`.
178
187
This example adds [`collective.easyform`](https://pypi.org/project/collective.easyform/).
@@ -184,16 +193,11 @@ dependencies = [
184
193
"plone.api",
185
194
"plone.classicui",
186
195
"plone.app.caching",
187
-
"collective.easyform==4.5.1",
196
+
"collective.easyform",
188
197
]
189
198
```
190
199
191
-
```{note}
192
-
When installing an add-on from source, it's best not to pin a version.
193
-
This way you always get the version that's currently available in the source control system.
194
-
```
195
-
196
-
Next add the add-on to `zcml_package_includes` in the file {file}`backend/instance.yaml` so that its configuration will load.
200
+
To configure the add-on to load, in the file {file}`backend/instance.yaml`, under the key `default_context`, for the key `zcml_package_includes`, set its value to the add-on's name.
197
201
198
202
```yaml
199
203
default_context:
@@ -213,18 +217,10 @@ extras=test
213
217
The {file}`mx.ini` file configures a tool called {term}`mxdev`.
214
218
For an explanation of why Plone uses `mxdev`, see {ref}`manage-packages-mxdev-label`.
215
219
```
216
-
217
-
Stop the backend with {kbd}`ctrl-c`.
218
-
219
-
To actually download and install the new add-on, run the following command.
220
-
221
-
```shell
222
-
make backend-build
223
-
```
224
-
225
220
````
226
221
227
222
````{tab-item} Buildout
223
+
:sync: buildout
228
224
229
225
Update the file {file}`buildout.cfg`.
230
226
This example uses [`collective.easyform`](https://pypi.org/project/collective.easyform/).
0 commit comments