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/backend/content-types/index.md
+223-8Lines changed: 223 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,15 +12,230 @@ myst:
12
12
# Content Types
13
13
14
14
```{seealso}
15
-
See the chapter {ref}`training:dexterity1-label` from the Mastering Plone 6 Training.
15
+
See the chapter {ref}`training:dexterity1-label` from the Mastering Plone 6 Training for a step-by-step tutorial to create a custom content type.
16
16
```
17
17
18
-
```{todo}
19
-
Contribute to this documentation!
20
-
See issue [Backend > Content Types needs content](https://github.com/plone/documentation/issues/1303).
18
+
## What is a content type?
19
+
20
+
Each item in a Plone site is an instance of a particular content type.
21
+
We have different content types to reflect the different kinds of information about which we need to collect and display information.
22
+
23
+
Pages, news items, events, files (binary), and images are examples of content types.
24
+
25
+
Lots of things in Plone can be configured to work differently based on the content type. For example, each content type has:
26
+
- a {ref}`schema <backend-fields-label>` specifying the fields which can be edited for the content type
27
+
- a list of {ref}`behaviors <backend-behaviors-label>` which supply additional functionality that can be attached to the content types for which the behavior is enabled
28
+
- a {ref}`workflow <backend-workflows-label>` controlling transitions between publishing states and associated permissions
29
+
- a version policy controlling whether to store a revision history
30
+
31
+
It is common in developing a web site that you'll need customized versions of common content types, or perhaps even entirely new types.
32
+
33
+
## Factory Type Information
34
+
35
+
A content type is defined by creating a {term}`Factory Type Information` (FTI) object.
36
+
37
+
To create an FTI in a GenericSetup profile, add the content type to the list in `types.xml`. For example, this adds the standard Plone page (Document) content type:
Describe how to add a content type (Python/XML) including FTI settings.
25
-
Fields, Widgets, Vocabularies are also described in detail in their own chapters, and will be referenced from examples here.
26
-
```
146
+
The `name` attribute on the root element in the XML must match the name in the filename and the name listed in `types.xml`.
147
+
148
+
Set the `i18n:domain` to the i18n domain which includes translations for this content type. This is usually the same as the name of the Python package which contains the content type.
149
+
150
+
151
+
(global-fti-properties-label)=
152
+
153
+
### Global FTI properties
154
+
155
+
The XML sets a number of FTI properties that are used globally, in both Classic UI and Volto:
156
+
157
+
`action` elements
158
+
: Defines additional {doc}`actions </backend/portal-actions>` which are available for this content type.
159
+
160
+
`add_permission`
161
+
: Id of the permission controlling whether the current user has permission to add this content type.
162
+
163
+
`allow_discussion`
164
+
: Boolean.
165
+
Controls whether Plone's commenting system is enabled by default for this content type.
166
+
167
+
`allowed_content_types`
168
+
: List of content types which can be added inside this one.
169
+
Only used if `filter_content_types` is True.
170
+
171
+
`behaviors`
172
+
: List of {doc}`behaviors </backend/behaviors>` enabled for this content type.
173
+
174
+
`description`
175
+
: Short description displayed in the UI.
176
+
177
+
`factory`
178
+
: Name of the factory adapter used to create new instances of the content type.
179
+
Usually the same as the content type name.
180
+
181
+
`filter_content_types`
182
+
: Boolean.
183
+
Controls which content types can be added inside this one.
184
+
If `True`, allow only the types listed in `allowed_content_types`.
185
+
If `False`, allow any content type that the user has permission to add.
186
+
187
+
`global_allow`
188
+
: Boolean.
189
+
Set to `True` to allow adding the content type anywhere in the site where the user has permission.
190
+
Set to `False` to only allow adding it inside other content types that include this one in `allowed_content_types`.
191
+
192
+
`klass`
193
+
: Dotted path to the Python class for this content type.
194
+
195
+
`model_file`
196
+
: Location of an XML file to load as the content type's schema.
197
+
This is an alternative to `schema` and `model_source`.
198
+
199
+
`model_source`
200
+
: Inline XML schema for the content type.
201
+
This is an alternative to `schema` and `model_file`.
202
+
203
+
`schema`
204
+
: Dotted path to the Python schema for this content type.
205
+
One of `model_file`, `model_source`, and `schema` must be set.
206
+
`schema` is the most commonly used.
207
+
208
+
`title`
209
+
: The name of the content type displayed in the UI.
210
+
211
+
212
+
213
+
(classic-ui-only-fti-properties-label)=
214
+
215
+
### Classic UI only FTI properties
216
+
217
+
The following FTI properties are used only in Classic UI:
218
+
219
+
`add_view_expr`
220
+
: {term}`TALES` expression returning the URL for the form to add a new item of this content type.
221
+
222
+
`alias` elements
223
+
: Controls a mapping from URL to views.
224
+
It's not common to change this.
225
+
226
+
`default_view`
227
+
: Name of the default view used to display this content type.
228
+
229
+
`default_view_fallback`
230
+
: Boolean.
231
+
If `True`, the `default_view` will be used if the assigned view is not found.
232
+
233
+
`icon_expr`
234
+
: {term}`TALES` expression returning the name of one of the registered icons.
235
+
See {doc}`/classic-ui/icons`.
236
+
237
+
`immediate_view`
238
+
: Name of the view alias to display after a new item is added.
239
+
240
+
`view_methods`
241
+
: List of views which can be selected to display this content type.
0 commit comments