|
1 | 1 | --- |
2 | 2 | myst: |
3 | 3 | html_meta: |
4 | | - "description": "" |
5 | | - "property=og:description": "" |
6 | | - "property=og:title": "" |
7 | | - "keywords": "" |
| 4 | + "description": "How to find and add behaviors in Plone content types" |
| 5 | + "property=og:description": "How to find and add behaviors in Plone content types" |
| 6 | + "property=og:title": "How to find and add behaviors in Plone content types" |
| 7 | + "keywords": "Plone, content types, behaviors" |
8 | 8 | --- |
9 | 9 |
|
10 | | -# Using behaviors |
| 10 | +# Behaviors |
11 | 11 |
|
12 | | -**Finding and adding behaviors** |
| 12 | +This chapter describes how to find and add behaviors. |
13 | 13 |
|
14 | | -Dexterity introduces the concept of *behaviors* – re-usable bundles of |
15 | | -functionality and/or form fields which can be turned on or off on a |
16 | | -per-type basis. |
| 14 | +Dexterity introduces the concept of *behaviors*, which are reusable bundles of functionality or form fields which can be turned on or off on a per-type basis. |
17 | 15 |
|
18 | | -Each behavior has a unique interface. When a behavior is enabled on a |
19 | | -type, you will be able to adapt that type to the behavior’s interface. |
20 | | -If the behavior is disabled, the adaptation will fail. The behavior |
21 | | -interface can also be marked as an `IFormFieldsProvider`, in which case |
22 | | -it will add fields to the standard add and edit forms. Finally, a |
23 | | -behavior may imply a sub-type: a marker interface which will be |
24 | | -dynamically provided by instances of the type for which the behavior is |
25 | | -enabled. |
| 16 | +Each behavior has a unique interface. |
| 17 | +When a behavior is enabled on a type, you will be able to adapt that type to the behavior's interface. |
| 18 | +If the behavior is disabled, the adaptation will fail. |
| 19 | +The behavior interface can also be marked as an `IFormFieldsProvider`, in which case it will add fields to the standard add and edit forms. |
| 20 | +Finally, a behavior may imply a sub-type: a marker interface which will be dynamically provided by instances of the type for which the behavior is enabled. |
26 | 21 |
|
27 | | -We will not cover writing new behaviors in this manual, but we will show |
28 | | -how to enable behaviors on a type. Writing behaviors is covered in the |
29 | | -[Behaviors manual](http://docs.plone.org/external/plone.app.dexterity/docs/behaviors/index.html). |
| 22 | +We will not cover writing new behaviors here, but we will show how to enable behaviors on a type. |
| 23 | +Writing behaviors is covered in {doc}`/backend/behaviors`. |
30 | 24 |
|
31 | | -In fact, we’ve already seen one |
32 | | -standard behavior applied to our example types, registered in the FTI |
33 | | -and imported using GenericSetup: |
| 25 | +In fact, we've already seen one standard behavior applied to our example types, registered in the FTI and imported using GenericSetup. |
34 | 26 |
|
35 | 27 | ```xml |
36 | 28 | <property name="behaviors"> |
37 | 29 | <element value="plone.app.content.interfaces.INameFromTitle" /> |
38 | 30 | </property> |
39 | 31 | ``` |
40 | 32 |
|
41 | | -Other behaviors are added in the same way, by listing additional |
42 | | -behavior interfaces as elements of the `behaviors` property. |
| 33 | +Other behaviors are added in the same way, by listing additional behavior interfaces as elements of the `behaviors` property. |
43 | 34 |
|
44 | | -Behaviors are normally registered with the `<plone:behavior />` ZCML |
45 | | -directive. When registered, a behavior will create a global utility |
46 | | -providing `IBehavior`, which is used to provide some metadata, such as a |
47 | | -title and description for the behavior. |
| 35 | +Behaviors are normally registered with the `<plone:behavior />` ZCML directive. |
| 36 | +When registered, a behavior will create a global utility providing `IBehavior`, which is used to provide some metadata, such as a title and description for the behavior. |
48 | 37 |
|
49 | | -You can find and apply behaviors via the {guilabel}`Dexterity Content Types` |
50 | | -control panel that is installed with [plone.app.dexterity]. For a list |
51 | | -of standard behaviors that ship with Dexterity, see the reference at the |
52 | | -end of this manual. |
53 | | - |
54 | | -[plone.app.dexterity]: http://pypi.python.org/pypi/plone.app.dexterity |
| 38 | +You can find and apply behaviors via the {guilabel}`Dexterity Content Types` control panel that is installed with [`plone.app.dexterity`](https://pypi.org/project/plone.app.dexterity/). |
| 39 | +For a list of standard behaviors that ship with Plone, see {ref}`backend-built-in-behaviors-label`. |
0 commit comments