Skip to content

Commit aadcec3

Browse files
committed
Tidy behaviors.md, add label and reference to Built-in behaviors
1 parent d47f17b commit aadcec3

File tree

2 files changed

+22
-35
lines changed

2 files changed

+22
-35
lines changed

docs/backend/behaviors.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ A key feature of behaviors is that they allow encapsulating functionality so tha
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

37+
(backend-built-in-behaviors-label)=
38+
3739
## Built-in behaviors
3840

3941
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`.
Lines changed: 20 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,39 @@
11
---
22
myst:
33
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"
88
---
99

10-
# Using behaviors
10+
# Behaviors
1111

12-
**Finding and adding behaviors**
12+
This chapter describes how to find and add behaviors.
1313

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

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

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`.
3024

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

3527
```xml
3628
<property name="behaviors">
3729
<element value="plone.app.content.interfaces.INameFromTitle" />
3830
</property>
3931
```
4032

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

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

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

Comments
 (0)