Skip to content

Commit 5c451c1

Browse files
authored
Merge branch '6.0' into erral-language-redirect-documentation
2 parents 5d08c67 + b47270e commit 5c451c1

File tree

10 files changed

+115
-111
lines changed

10 files changed

+115
-111
lines changed

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[submodule "submodules/volto"]
22
path = submodules/volto
33
url = https://github.com/plone/volto.git
4-
branch = master
4+
branch = main
55
[submodule "submodules/plone.restapi"]
66
path = submodules/plone.restapi
77
url = https://github.com/plone/plone.restapi.git

docs/backend/content-types/index.md

Lines changed: 52 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ myst:
99

1010
(backend-content-types-label)=
1111

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.
1316

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-
```
1717

1818
## What is a content type?
1919

@@ -22,19 +22,59 @@ We have different content types to reflect the different kinds of information ab
2222

2323
Pages, news items, events, files (binary), and images are examples of content types.
2424

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
3032

3133
It is common in developing a web site that you'll need customized versions of common content types, or perhaps even entirely new types.
3234

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+
% designing
57+
% prerequisite
58+
% schema-driven-types
59+
% model-driven-types
60+
% custom-views
61+
% advanced/index
62+
% testing/index
63+
% reference/index
64+
```
65+
66+
3367
## Factory Type Information
3468

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+
3574
A content type is defined by creating a {term}`Factory Type Information` (FTI) object.
3675

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:
3878

3979
```xml
4080
<object name="portal_types">
@@ -145,7 +185,8 @@ In this example, the file is `types/Document.xml` and contains this XML:
145185

146186
The `name` attribute on the root element in the XML must match the name in the filename and the name listed in `types.xml`.
147187

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.
149190

150191

151192
(global-fti-properties-label)=
@@ -209,7 +250,6 @@ The XML sets a number of FTI properties that are used globally, in both Classic
209250
: The name of the content type displayed in the UI.
210251

211252

212-
213253
(classic-ui-only-fti-properties-label)=
214254

215255
### Classic UI only FTI properties

docs/classic-ui/images.md

Lines changed: 52 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,15 +199,15 @@ Or you can get the HTML tag back, and replace the current tag with it:
199199

200200
```xml
201201
<div tal:define="scale_view context/@@images">
202-
<img tal:replace="structured python: scale_view.tag('image', 'mini')">
202+
<img tal:replace="structure python: scale_view.tag('image', 'mini')">
203203
</div>
204204
```
205205

206206
You can also provide the following keyword arguments to set `title`, `alt`, or `css_class` for the generated tag:
207207

208208
```xml
209209
<div tal:define="scale_view context/@@images">
210-
<img tal:replace="structured python: scale_view.tag('banner', 'mini', title='The Banner', alt='Alternative text', css_class='banner')">
210+
<img tal:replace="structure python: scale_view.tag('banner', 'mini', title='The Banner', alt='Alternative text', css_class='banner')">
211211
</div>
212212
```
213213

@@ -460,3 +460,53 @@ This will result in a `srcset` as in the following example for a medium image:
460460
Please note that this example has the `resolve_uid_and_caption` filter disabled to see the scale names better.
461461
The real `src` URLs look more like `http://localhost:8080/Plone50/dsc04791.jpg/@@images/778f9c06-36b0-485d-ab80-12c623dc4bc3.jpeg`.
462462
```
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.
469+
470+
```python
471+
(Pdb) pp brain.image_scales
472+
{'picture': [{'content-type': 'image/jpeg',
473+
'download': '@@images/picture-800-ddae07fbc46b293155bd6fcda7f2572a.jpeg',
474+
'filename': 'my-picture.jpg',
475+
'height': 800,
476+
'scales': {'icon': {'download': '@@images/picture-32-f2f815374aa5434e06fb3a95306527fd.jpeg',
477+
'height': 32,
478+
'width': 32},
479+
'large': {'download': '@@images/picture-800-4dab3b3cc42abb6fad29258c7430070a.jpeg',
480+
'height': 800,
481+
'width': 800},
482+
'listing': {'download': '@@images/picture-16-d3ac2117158cf38d0e15c5f5feb8b75d.jpeg',
483+
'height': 16,
484+
'width': 16},
485+
'mini': {'download': '@@images/picture-200-3de96ae4288dfb18f5589c89b861ecc1.jpeg',
486+
'height': 200,
487+
'width': 200},
488+
'preview': {'download': '@@images/picture-400-60f60942c8e4ddd7dcdfa90527a8bae0.jpeg',
489+
'height': 400,
490+
'width': 400},
491+
'teaser': {'download': '@@images/picture-600-1ada88b8af6748e9cbe18a34c3127443.jpeg',
492+
'height': 600,
493+
'width': 600},
494+
'thumb': {'download': '@@images/picture-128-80fce253497f7a745315f58f3e8f3a0c.jpeg',
495+
'height': 128,
496+
'width': 128},
497+
'tile': {'download': '@@images/picture-64-220d6703eac104c59774a379a8276e76.jpeg',
498+
'height': 64,
499+
'width': 64}},
500+
'size': 238977,
501+
'width': 800}]}
502+
```
503+
504+
This information shows we have everything we need to generate our image URLs, without waking up any objects.
505+
506+
```xml
507+
<li tal:define="preview python: brain.image_scales['picture'][0]['scales']['preview']">
508+
<img src="${brain/getURL}/${python: preview['download']}"
509+
width="${python: preview['width']}"
510+
height="${python: preview['height']}" />
511+
</li>
512+
```

docs/classic-ui/layers.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,8 @@ Then views and viewlets from your product can be enabled on the site instance us
5858
### Unconditional overrides
5959

6060
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`.
6763

6864

6965
(classic-ui-creating-a-layer-label)=

docs/classic-ui/views.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ You need to declare the `browser` namespace in your `configure.zcml` to use `bro
173173
```
174174

175175
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.
177177

178178

179179
(classic-ui-page-template-label)=
@@ -432,7 +432,7 @@ Since one Zope application server can contain multiple Plone sites, layers are u
432432
A layer is in use when either:
433433

434434
- 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.
436436

437437
You should register your views against a certain layer in your own code.
438438

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ def source_replace(app, docname, source):
319319
# Dict of replacements.
320320
source_replacements = {
321321
"{PLONE_BACKEND_MINOR_VERSION}": "6.0",
322-
"{PLONE_BACKEND_PATCH_VERSION}": "6.0.6",
322+
"{PLONE_BACKEND_PATCH_VERSION}": "6.0.7",
323323
"{NVM_VERSION}": "0.39.3",
324324
}
325325

docs/glossary.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,8 @@ Diazo
121121
Diazo allows you to apply a theme contained in a static HTML web page to a dynamic website created using any server-side technology.
122122
123123
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.
125126
126127
Dublin Core
127128
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
515516
It can be used for developing any Python application.
516517
Maybe it should be called Python Component Architecture.
517518
```{seealso}
518-
See also https://muthukadan.net/docs/zca.html.
519+
See also https://zopecomponent.readthedocs.io/en/latest/index.html.
519520
```
520521
521522
browser layer

plone.app.dexterity/intro.md

Lines changed: 0 additions & 83 deletions
This file was deleted.

submodules/volto

Submodule volto updated 324 files

0 commit comments

Comments
 (0)