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
+52-12Lines changed: 52 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,11 +9,11 @@ myst:
9
9
10
10
(backend-content-types-label)=
11
11
12
-
# Content Types
12
+
# Content types
13
+
14
+
This part of the documentation describes how to develop content types in Plone.
15
+
Content types are implemented through the {term}`Dexterity` framework.
13
16
14
-
```{seealso}
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
-
```
17
17
18
18
## What is a content type?
19
19
@@ -22,19 +22,59 @@ We have different content types to reflect the different kinds of information ab
22
22
23
23
Pages, news items, events, files (binary), and images are examples of content types.
24
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
25
+
Lots of things in Plone can be configured to work differently based on the content type.
26
+
For example, each content type has:
27
+
28
+
- a {ref}`schema <backend-fields-label>` specifying the fields which can be edited for the content type
29
+
- 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
30
+
- a {ref}`workflow <backend-workflows-label>` controling transitions between publishing states and associated permissions
31
+
- a version policy controling whether to store a revision history
30
32
31
33
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
34
35
+
36
+
## Topics
37
+
38
+
This part of the documentation will cover the following topics.
39
+
40
+
- Some basic design techniques for solving problems with content types in Plone
41
+
- Setting up a Dexterity development environment
42
+
- Creating a package to house your types
43
+
- Building a custom type based on a schema
44
+
- Creating custom views and forms for your type
45
+
- Advanced customization, including workflow and security
46
+
- Testing your types
47
+
- A quick reference to common fields, widgets, and APIs
48
+
49
+
```{seealso}
50
+
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.
51
+
```
52
+
53
+
```{toctree}
54
+
:maxdepth: 2
55
+
```
56
+
% Uncomment each of the following and move into the toctree above when migrated from Plone 5 documentation
57
+
% designing
58
+
% prerequisite
59
+
% schema-driven-types
60
+
% model-driven-types
61
+
% custom-views
62
+
% advanced/index
63
+
% testing/index
64
+
% reference/index
65
+
66
+
33
67
## Factory Type Information
34
68
69
+
```{todo}
70
+
Find a new home for this section.
71
+
This page is an introduction, whereas FTI is a topic unto itself.
72
+
```
73
+
35
74
A content type is defined by creating a {term}`Factory Type Information` (FTI) object.
36
75
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:
76
+
To create an FTI in a `GenericSetup` profile, add the content type to the list in `types.xml`.
77
+
For example, this adds the standard Plone page (`Document`) content type:
38
78
39
79
```xml
40
80
<objectname="portal_types">
@@ -145,7 +185,8 @@ In this example, the file is `types/Document.xml` and contains this XML:
145
185
146
186
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
187
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.
188
+
Set the `i18n:domain` to the i18n domain which includes translations for this content type.
189
+
This is usually the same as the name of the Python package which contains the content type.
149
190
150
191
151
192
(global-fti-properties-label)=
@@ -209,7 +250,6 @@ The XML sets a number of FTI properties that are used globally, in both Classic
209
250
: The name of the content type displayed in the UI.
@@ -460,3 +460,53 @@ This will result in a `srcset` as in the following example for a medium image:
460
460
Please note that this example has the `resolve_uid_and_caption` filter disabled to see the scale names better.
461
461
The real `src` URLs look more like `http://localhost:8080/Plone50/dsc04791.jpg/@@images/778f9c06-36b0-485d-ab80-12c623dc4bc3.jpeg`.
462
462
```
463
+
464
+
## Image scales from catalog brain
465
+
466
+
For all `NamedBlobImage` fields, we can get existing scale information directly from the catalog brain.
467
+
468
+
Given a content type with a `NamedBlobField` named `picture`, we can get the following information by calling the `image_scales` attribute on the catalog brain.
Copy file name to clipboardExpand all lines: docs/classic-ui/layers.md
+2-6Lines changed: 2 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -58,12 +58,8 @@ Then views and viewlets from your product can be enabled on the site instance us
58
58
### Unconditional overrides
59
59
60
60
If you want to override a view or a viewlet unconditionally for all sites without the add-on product installer support, you need to use `overrides.zcml`.
61
-
62
-
```{todo}
63
-
Explain how to use an `overrides.zcml`.
64
-
65
-
See https://github.com/plone/documentation/issues/1426
66
-
```
61
+
You can override classes and templates in this file.
62
+
To do this, you put the ZCML registration in a file called `overrides.zcml` in the package root, next to the top-most `configure.zcml`.
Copy file name to clipboardExpand all lines: docs/classic-ui/views.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -173,7 +173,7 @@ You need to declare the `browser` namespace in your `configure.zcml` to use `bro
173
173
```
174
174
175
175
The view in question is registered against a {ref}`layer <classic-ui-layers-label>`.
176
-
It will be available after restart, after running the {ref}`GenericSetup profile <backend-configuration-registry-generic-setup-label>`.
176
+
It will be available after restart and running the {ref}`GenericSetup profile <backend-configuration-registry-generic-setup-label>`, or enabling the add-on.
177
177
178
178
179
179
(classic-ui-page-template-label)=
@@ -432,7 +432,7 @@ Since one Zope application server can contain multiple Plone sites, layers are u
432
432
A layer is in use when either:
433
433
434
434
- a theme which defines that layer is active, or
435
-
- if a specific add-on product which defines that layer is installed.
435
+
- if a specific add-on product which defines that layer is installed in the Plone site.
436
436
437
437
You should register your views against a certain layer in your own code.
438
438
@@ -637,11 +637,11 @@ This way you also have a test for the generated view.
637
637
638
638
## Guided information
639
639
640
-
The Mastering Plone Training has several chapters on views.
640
+
The Mastering Plone 5 Training has several chapters on views.
Copy file name to clipboardExpand all lines: docs/glossary.md
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -121,7 +121,8 @@ Diazo
121
121
Diazo allows you to apply a theme contained in a static HTML web page to a dynamic website created using any server-side technology.
122
122
123
123
Dexterity
124
-
[Dexterity](https://github.com/plone/plone.dexterity), the base framework for building content types, both through-the-web and as filesystem code for Zope.
124
+
[Dexterity](https://github.com/plone/plone.dexterity) is the base framework for building content types, both through-the-web and as filesystem code.
125
+
It is aimed at Plone, although this package should work with plain Zope + CMF systems.
125
126
126
127
Dublin Core
127
128
The Dublin Core Schema is a small set of vocabulary terms that can be used to describe web resources (video, images, web pages, etc.), as well as physical resources such as books or CDs, and objects like artworks.
@@ -515,7 +516,7 @@ Zope Component Architecture
515
516
It can be used for developing any Python application.
516
517
Maybe it should be called Python Component Architecture.
517
518
```{seealso}
518
-
See also https://muthukadan.net/docs/zca.html.
519
+
See also https://zopecomponent.readthedocs.io/en/latest/index.html.
Volto does not rely on the configuration set in Plone's Language Control Panel to handle the redirection from the root of the site to the Language Root Folder.
15
+
16
+
Volto has a setting in its own configuration stating whether a site is multilingual or not: `isMultilingual`.
17
+
18
+
First of all, you need to set that setting to `true`.
19
+
20
+
Then you need to add the list of supported languages to the `supportedLanguages` setting, and match them with the languages configured in Plone's Language Control Panel.
21
+
22
+
As a last thing, you need to set your site's `defaultLanguage` to one of the `supportedLanguages`.
23
+
24
+
When all these settings are configured, Volto's [`MultilingualRedirector`](https://github.com/plone/volto/blob/main/src/components/theme/MultilingualRedirector/MultilingualRedirector.jsx) will handle the language negotiation and the redirect.
25
+
26
+
In its configuration, the component tries to match the `I18N_LANGUAGE` cookie set in the user's browser with the list of supported languages, and if the match does not succeed, it selects the default language configured in Volto.
27
+
28
+
After that it does the redirection to the matched Language Root Folder.
29
+
30
+
If the site is not configured to be multilingual, Volto doesn't do any redirect.
31
+
32
+
## Overriding the default behavior
33
+
34
+
To do so, you need to provide your own `MultilingualRedirector` component {doc}`customizing it </volto/recipes/customizing-components>`.
0 commit comments