|
1 | 1 | --- |
2 | 2 | myst: |
3 | 3 | html_meta: |
4 | | - "description": "Dexterity content type overview." |
5 | | - "property=og:description": "Dexterity content type overview." |
6 | | - "property=og:title": "Content Types" |
7 | | - "keywords": "Content Types, Dexterity" |
| 4 | + "description": "How to develop Dexterity content types in Plone." |
| 5 | + "property=og:description": "How to develop Dexterity content types in Plone." |
| 6 | + "property=og:title": "Content types" |
| 7 | + "keywords": "Content types, Dexterity, Plone" |
8 | 8 | --- |
9 | 9 |
|
10 | 10 | # Content Types |
11 | 11 |
|
| 12 | +This part of the documentation describes how to develop content types in Plone. |
| 13 | +Content types are implemented through the {term}`Dexterity` framework. |
| 14 | + |
| 15 | + |
| 16 | +## What is a content type? |
| 17 | + |
| 18 | +Each item in a Plone site is an instance of a particular content type. |
| 19 | +We have different content types to reflect the different kinds of information about which we need to collect and display information. |
| 20 | + |
| 21 | +`Folder`, `Page`, `News item`, `Event`, `File` (binary), and `Image` are examples of content types. |
| 22 | + |
| 23 | +Lots of things in Plone can be configured to work differently based on the content type. |
| 24 | +For example, each content type has: |
| 25 | + |
| 26 | +- a {doc}`schema </backend/schemas>` specifying the fields which can be edited for the content type |
| 27 | +- a list of {doc}`behaviors </backend/behaviors>` which supply additional functionality that can be attached to the content types for which the behavior is enabled |
| 28 | +- a {doc}`workflow </backend/workflows>` controling transitions between publishing states and associated permissions |
| 29 | +- a version policy controling whether to store a revision history |
| 30 | + |
| 31 | +It is common in developing a website that you'll need customized versions of common content types, or perhaps even entirely new types. |
| 32 | + |
| 33 | + |
| 34 | +## Designing with content types |
| 35 | + |
| 36 | +Plone uses the ZODB, an object database, instead of a relational database as its default content store. |
| 37 | +The ZODB is well suited to heterogeneous, loosely structured content such as web pages. |
| 38 | + |
| 39 | +Types in Plone are either `containers` or `items` (this distinction is sometimes called folderish versus non-folderish). |
| 40 | +A one-to-many type relationship is typically modeled as a container (the "one") containing many items (the "many"), although it is also possible to use references across the content hierarchy. |
| 41 | + |
| 42 | +Each type has a {doc}`schema </backend/schemas>`, which is a set of {doc}`/backend/fields` with related properties, such as a title, default value, constraints, and so on. |
| 43 | +The schema is used to generate forms and describe instances of the type. |
| 44 | +In addition to schema-driven forms, a type typically comes with one or more {doc}`/classic-ui/views` as well as {doc}`/classic-ui/viewlets` and is subject to security—for example, add permissions, or per-field read and write permissions—and workflow. |
| 45 | + |
| 46 | + |
| 47 | +## Topics |
| 48 | + |
| 49 | +This part of the documentation will cover the following topics. |
| 50 | + |
| 51 | +- Some basic design techniques for solving problems with content types in Plone |
| 52 | +- Setting up a Dexterity development environment |
| 53 | +- Creating a package to house your types |
| 54 | +- Building a custom type based on a schema |
| 55 | +- Creating custom views and forms for your type |
| 56 | +- Advanced customization, including workflow and security |
| 57 | +- Testing your types |
| 58 | +- A quick reference to common fields, widgets, and APIs |
| 59 | + |
| 60 | +```{seealso} |
| 61 | +See the chapter {doc}`training:mastering-plone/dexterity` from the Mastering Plone 6 Training for a step-by-step tutorial to create a custom content type. |
| 62 | +``` |
| 63 | + |
| 64 | + |
12 | 65 | ```{toctree} |
13 | 66 | :maxdepth: 2 |
14 | | -intro |
| 67 | +:caption: Table of contents |
15 | 68 | creating-content-types |
16 | 69 | fti |
17 | | -``` |
| 70 | +``` |
| 71 | + |
| 72 | +```{toctree} |
| 73 | +:maxdepth: 2 |
| 74 | +``` |
| 75 | +% Uncomment each of the following and move into the toctree above when migrated from Plone 5 documentation |
| 76 | +% prerequisite |
| 77 | +% schema-driven-types |
| 78 | +% model-driven-types |
| 79 | +% custom-views |
| 80 | +% advanced/index |
| 81 | +% testing/index |
| 82 | +% reference/index |
0 commit comments