Skip to content

Commit 20c92c4

Browse files
authored
Merge branch '6.0' into linkcheck-news-volto
2 parents fadfcc5 + d5ba93f commit 20c92c4

37 files changed

+3463
-468
lines changed

.github/ISSUE_TEMPLATE/new-issue-form.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,18 @@ body:
55
attributes:
66
value: |
77
Thanks for taking the time to fill out this issue report!
8-
- type: checkboxes
9-
id: plone-versions
8+
- type: textarea
9+
id: documentation-url
1010
attributes:
11-
label: Plone Documentation versions affected
12-
options:
13-
- label: 5.x
14-
- label: 6.x
11+
label: Links of affected pages in Plone Documentation, if any.
12+
value: |
13+
- Link_1
14+
- Link_2
15+
- ...
1516
- type: textarea
1617
id: description
1718
attributes:
1819
label: Description
19-
description: If relevant, please include links to the affected resources, screenshots, and any other helpful information.
20+
description: Include include screenshots and any other helpful information.
2021
validations:
2122
required: true

.github/PULL_REQUEST_TEMPLATE/pull_request_template.md renamed to .github/pull_request_template.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
## First-time contributors
2+
3+
You **must** read and follow our [First-time contributors](https://6.docs.plone.org/contributing/first-time.html).
4+
5+
---
6+
7+
## Submit a pull request
8+
19
Thank you for your contribution to the Plone Documentation.
210

311
Before submitting this pull request, please make sure you follow our guides:
@@ -7,9 +15,9 @@ Before submitting this pull request, please make sure you follow our guides:
715
- [Authors guide](https://6.docs.plone.org/contributing/authors.html)
816
- [MyST reference](https://6.docs.plone.org/contributing/myst-reference.html)
917

10-
## Issue Number
18+
## Issue number
1119

12-
- Issue #
20+
- Fixes #
1321

1422
## Description
1523

.vale.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ Packages = Microsoft
88

99
[*]
1010
BasedOnStyles = Vale, Microsoft
11+
Microsoft.Contractions = suggestion
12+
Microsoft.Units = suggestion

docs/backend/behaviors.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Other behaviors are implemented as add-on products, which can be installed and c
3030
Once a behavior has been installed, it can be applied to any content type by selecting it in the {guilabel}`Content Types` control panel.
3131
This allows items of this content type to gain the additional functionality provided by the behavior.
3232

33-
A key feature of behaviors is that they allow encapsulating functionality so that it can be reused for multiple content types without needing to reimplement it.
33+
A key feature of behaviors is that they allow encapsulating functionality so that it can be reused for multiple content types without needing to implement it again.
3434
Overall, behaviors are an important part of the Plone content management system and allow for powerful customization and extensibility of content objects.
3535

3636

@@ -40,7 +40,7 @@ Overall, behaviors are an important part of the Plone content management system
4040

4141
To view a complete list of built-in behaviors, browse to {guilabel}`Content Types` control panel, then click {guilabel}`Page` (or any other content type), then {guilabel}`Behaviors`.
4242

43-
| short name | Title | Desription |
43+
| short name | Title | Description |
4444
|---|---|---|
4545
| `plone.allowdiscussion` | Allow discussion | Allow discussion on this item |
4646
| `plone.basic` | Basic metadata | Adds title and description fields. |
@@ -72,11 +72,11 @@ To view a complete list of built-in behaviors, browse to {guilabel}`Content Type
7272
| `volto.preview_image` | Preview Image | Preview image for listings |
7373
| `volto.preview_image_link` | Preview Image Link | Preview image for listings based on links |
7474
| `plone.relateditems` | Related items | Adds the ability to assign related items |
75-
| `plone.richtext` | RichText | Adds richtext behavior |
75+
| `plone.richtext` | RichText | Adds RichText behavior |
7676
| `plone.shortname` | Short name | Gives the ability to rename an item from its edit form. |
7777
| `plone.tableofcontents` | Table of contents | Adds a table of contents |
78-
| `plone.thumb_icon` | Thumbs and icon handling | Options to suppress thumbs and/or icons and to override thumb size in listings, tables etc.
79-
| `plone.versioning` | Versioning | Versioning support with CMFEditions |
78+
| `plone.thumb_icon` | Thumbs and icon handling | Options to suppress thumbs or icons and to override thumb size in listings, tables, and other user interface elements |
79+
| `plone.versioning` | Versioning | Versioning support with `CMFEditions` |
8080

8181
```{todo}
8282
For each behavior in the table above, one may view the source code of the checkbox (its `name` attribute) to view its Short Name.
@@ -307,7 +307,7 @@ You do not *need* to know this, but it may help if you run into problems.
307307
```
308308

309309
In Plone, behaviors can be globally enabled on content types at runtime.
310-
With add-ons, behaviors can be enabled even on a single content object or for a whole subtree in the content hierarchy.
310+
With add-ons, behaviors can be enabled even on a single content object or for a whole subdirectory tree in the content hierarchy.
311311

312312

313313
### Interfaces and adapters
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
---
2+
myst:
3+
html_meta:
4+
"description": "Creating content types to manage tasks in Plone."
5+
"property=og:description": "Creating content types to manage tasks in Plone."
6+
"property=og:title": "Creating content types to manage tasks in Plone."
7+
"keywords": "Content Types, FTI, Dexterity, plonecli, bobtemplates.plone"
8+
---
9+
10+
# Creating content types
11+
12+
When we attempt to solve a particular content management problem with Plone, we will often design new content types.
13+
For the purpose of this example, we'll build a simple set of types to manage tasks.
14+
15+
- We will use a content type `Tasks` to hold all task objects and present a list of tasks to the user.
16+
This type is folderish (`Container`).
17+
- We will use a content type `Task` with the information about the task.
18+
Fields include name, description, and status of the task.
19+
This type is non-folderish (`Item`).
20+
21+
## Creating a Plone package
22+
23+
We typically create a content type inside a Plone package.
24+
We will use the {term}`plonecli` to create a Plone package and our content types.
25+
26+
```shell
27+
plonecli create addon collective.tasks
28+
cd collective.tasks
29+
```
30+
31+
## Adding content types
32+
33+
Let's add a content type called `Tasks`:
34+
35+
```shell
36+
plonecli add content_type
37+
```
38+
39+
Fill in the name `Tasks` for the first content type:
40+
41+
```console
42+
-> Content type name (Allowed: _ a-z A-Z and whitespace) [Todo Task]: Tasks
43+
```
44+
45+
We keep the default base class `Container` here:
46+
47+
```console
48+
--> Dexterity base class (Container/Item) [Container]:
49+
```
50+
51+
We keep the default `globally addable`:
52+
53+
```console
54+
--> Should the content type globally addable? [y]:
55+
```
56+
57+
We want to filter content types, which can be added to this container:
58+
59+
```console
60+
--> Should we filter content types to be added to this container? [n]: y
61+
```
62+
63+
We keep the default behaviors active:
64+
65+
```console
66+
--> Activate default behaviors? [y]:
67+
```
68+
69+
Now let's add a content type called `Task`:
70+
71+
```shell
72+
plonecli add content_type
73+
```
74+
75+
Fill in the name `Task` for the first content type:
76+
77+
```console
78+
-> Content type name (Allowed: _ a-z A-Z and whitespace) [Todo Task]: Task
79+
```
80+
81+
We change the base class to `Item` here:
82+
83+
```console
84+
--> Dexterity base class (Container/Item) [Container]: Item
85+
```
86+
87+
We don't want it to be globally addable `globally addable`:
88+
89+
```console
90+
--> Should the content type globally addable? [y]: n
91+
```
92+
93+
If we disable `globally addable`, the next question will ask for the parent content type, where we will answer `Tasks`:
94+
95+
```console
96+
--> Parent container portal_type name: Tasks
97+
```
98+
99+
For the rest of the questions, we can keep the defaults.
100+
101+
To test our new Plone package and its content types, we can use {term}`plonecli` to build a development environment and start Plone.
102+
103+
```shell
104+
plonecli build
105+
plonecli serve
106+
```
107+
108+
Your Plone is now running on http://localhost:8080.
109+
You can add a new Plone site, enable your add-on, and add your content types.
110+
111+
```{seealso}
112+
{term}`plonecli` takes care of all the details of a content type and its configuration.
113+
For more configuration details, see {doc}`fti`.
114+
```
115+
116+
For now your content type doesn't have any custom schema with fields defined.
117+
118+
See {doc}`/backend/schemas`, {doc}`/backend/fields` and {doc}`/backend/widgets` for information on how to add custom fields and widgets to your content type.
119+
120+
Also have a look at Plone {doc}`/backend/behaviors`, which provide default features you can enable per content type.

0 commit comments

Comments
 (0)