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
+216-8Lines changed: 216 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,15 +12,223 @@ 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. We have different content types to reflect the different kinds of information about which we need to collect and display information.
21
+
22
+
Pages, news items, events, files (binary) and images are examples of content types.
23
+
24
+
Lots of things in Plone can be configured to work differently based on the content type. For example, each content type has:
25
+
- a {ref}`schema <backend-fields-label>` specifying the fields which can be edited for the content type
26
+
- 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
27
+
- a {ref}`workflow <backend-workflows-label>` controlling transitions between publishing states and associated permissions
28
+
- a version policy controlling whether to store a revision history
29
+
30
+
It is common in developing a web site that you'll need customized versions of common content types, or perhaps even entirely new types.
31
+
32
+
## Factory Type Information
33
+
34
+
A content type is defined by creating a Factory Type Information (FTI) object.
35
+
36
+
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
-
```
145
+
The `name` attribute on the root element in the XML must match the name in the filename and the name listed in `types.xml`.
146
+
147
+
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.
148
+
149
+
The XML sets a number of FTI properties:
150
+
151
+
```{glossary}
152
+
:sorted: true
153
+
154
+
title
155
+
The name of the content type displayed in the UI.
156
+
157
+
description
158
+
Short description displayed in the UI.
159
+
160
+
factory
161
+
Name of the factory adapter used to create new instances of the content type.
162
+
Usually the same as the content type name.
163
+
164
+
add_permission
165
+
Id of the permission controlling whether the current user has permission to add this content type.
166
+
167
+
klass
168
+
Dotted path to the Python class for this content type.
169
+
170
+
schema
171
+
Dotted path to the schema for this content type.
172
+
173
+
model_file
174
+
Location of an XML file to load as the content type's schema.
175
+
This is an alternative to `schema` and `model_source`.
176
+
177
+
model_source
178
+
Inline XML schema for the content type.
179
+
This is an alternative to `schema` and `model_file`.
180
+
181
+
behaviors
182
+
List of {ref}`behaviors <backend-behaviors-label>` enabled for this content type.
183
+
184
+
global_allow
185
+
Boolean.
186
+
Set to True to allow adding the content type anywhere in the site where the user has permission.
187
+
Set to False to only allow adding it inside other content types that include this one in `allowed_content_types`.
188
+
189
+
filter_content_types
190
+
Boolean. Controls which content types can be added inside this one.
191
+
If True, allow only the types listed in `allowed_content_types`.
192
+
If False, allow any content type that the user has permission to add.
193
+
194
+
allowed_content_types
195
+
List of content types which can be added inside this one.
196
+
Only used if `filter_content_types` is True.
197
+
198
+
allow_discussion
199
+
Boolean. Controls whether Plone's commenting system is enabled for this content type.
200
+
201
+
`action` elements
202
+
Defines additional {ref}`actions <backend-portal-actions-label>` which are available for this content type.
203
+
```
204
+
205
+
The following FTI properties are only used in the Classic UI:
206
+
207
+
```{glossary}
208
+
:sorted: true
209
+
icon_expr
210
+
TALES expression returning the name of one of the registered icons.
211
+
See {ref}`classic-ui-icons-label`
212
+
213
+
link_target
214
+
TODO
215
+
216
+
add_view_expr
217
+
TALES expression returning the URL for the form to add a new item of this content type.
218
+
219
+
default_view
220
+
Name of the default view used to display this content type.
221
+
222
+
default_view_fallback
223
+
TODO
224
+
225
+
immediate_view
226
+
Name of the view alias to display after a new item is added.
227
+
228
+
view_methods
229
+
List of views which can be selected to display this content type.
0 commit comments