Skip to content

Commit dd6771f

Browse files
committed
Tidy behavior-basics.md
1 parent aad39ee commit dd6771f

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed
Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,35 @@
11
---
22
myst:
33
html_meta:
4-
"description": ""
5-
"property=og:description": ""
6-
"property=og:title": ""
7-
"keywords": ""
4+
"description": "The fundamental concepts behind behaviors for content types in Plone"
5+
"property=og:description": "The fundamental concepts behind behaviors for content types in Plone"
6+
"property=og:title": "The fundamental concepts behind behaviors for content types in Plone"
7+
"keywords": "Plone, content types, behavior, basics"
88
---
99

1010
# Behavior basics
1111

12-
**The fundamental concepts behind behaviors**
12+
This chapter describes the fundamental concepts behind behaviors.
1313

1414
Before we dive into the practical examples, we need to explain a few of the concepts that underpin behaviors.
1515

16-
At the most basic level, a behavior is like a conditional adapter.
17-
For a Dexterity content type, the default condition is, "is this behavior listed in the *behaviors* property in the FTI?"
16+
At the most basic level, a behavior is like a "conditional" adapter.
17+
For a Dexterity content type, the default condition is, "is this behavior listed in the `behaviors` property in the FTI?"
1818
But the condition itself is an adapter; in rare cases this can be overruled.
19-
When a behavior is enabled for a particular object, it will be possible to adapt that object to the behaviors interface.
19+
When a behavior is enabled for a particular object, it will be possible to adapt that object to the behavior's interface.
2020
If the behavior is disabled, adaptation will fail.
2121

22-
A behavior consist at the very least of an interface and some metadata, namely a title and a description.
22+
A behavior consists at the very least of an interface and some metadata, namely a title and a description.
2323
In most cases, there is also a *factory*, akin to an adapter factory, which will be invoked to get an appropriate adapter when requested.
24-
This is usually just a class that looks like any other adapter factory, although it will tend to be applicable to *Interface*, *IContentish* or a similarly broad context.
24+
This is usually just a class that looks like any other adapter factory, although it will tend to be applicable to `Interface`, `IContentish`, or a similarly broad context.
2525

2626
Behaviors may specify a *marker interface*, which will be directly provided by instances for which the behavior is enabled.
2727
This is useful if you want to conditionally enable event handlers or view components, which are registered for this marker interface.
28-
Some behaviors have no factory. In this case, the behavior interface and the marker interface must be one and the same.
29-
If a factory is given a marker interface different from the behavior interface must be declared.
28+
Some behaviors have no factory.
29+
In this case, the behavior interface and the marker interface must be one and the same.
30+
If a factory is given, a marker interface different from the behavior interface must be declared.
3031

31-
Behaviors are registered globally, using the *\<plone.behavior />* ZCML directive.
32-
This results in, among other things, a named utility providing *plone.behavior.interfaces.IBehavior* being registered.
33-
This utility contains various information about the behavior, such as its name, title, interface and (optional) marker interface.
32+
Behaviors are registered globally, using the `<plone.behavior />` ZCML directive.
33+
This results in, among other things, a named utility providing `plone.behavior.interfaces.IBehavior` being registered.
34+
This utility contains various information about the behavior, such as its name, title, interface, and (optional) marker interface.
3435
The utility name is the full dotted name to the behavior interface.

0 commit comments

Comments
 (0)