You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/backend/fields.md
+11-10Lines changed: 11 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -103,9 +103,9 @@ See [`plone.namedfile`](https://pypi.org/project/plone.namedfile/) and [plone.fo
103
103
|`NamedBlobFile`|`NamedBlobFile`| A binary uploaded file stored as a ZODB blob. Requires the `blobs` extra to `plone.namedfile`. Otherwise identical to `NamedFile`. |`IField`|
104
104
|`NamedBlobImage`|`NamedBlobImage`| A binary uploaded image stored as a ZODB blob. Requires the `blobs` extra to `plone.namedfile`. Otherwise identical to `NamedImage`. |`IField`|
105
105
106
-
#### NamedBlobImage
106
+
#### `NamedBlobImage`
107
107
108
-
The following example shows, how to create an Image object and attach the image file to it.
108
+
The following example shows how to create an `Image` object, and attach the image file to it.
109
109
110
110
```python
111
111
img_obj = api.content.create(
@@ -145,7 +145,8 @@ See [`plone.app.textfield`](https://pypi.org/project/plone.app.textfield/) for m
145
145
|`RichText`|`RichTextValue`| Stores a `RichTextValue`, which encapsulates a raw text value, the source MIME type, and a cached copy of the raw text transformed to the default output MIME type. |`IField`, `IRichText`|
146
146
147
147
148
-
The RichText field allows for alternative markups and content filtering.
148
+
The `RichText` field allows for alternative markups and content filtering.
149
+
The following code sample shows how to create a schema with a `RichText` field.
149
150
150
151
```python
151
152
from plone.app.textfield import RichText
@@ -208,17 +209,17 @@ class ITestSchema(model.Schema):
208
209
209
210
(backend-fields-richtextvalue-label)=
210
211
211
-
#### RichTextValue
212
+
#### `RichTextValue`
212
213
213
-
The `RichText` field, most of the time does not store a string.
214
+
The `RichText` field usually does not store a string.
214
215
Instead, it stores a `RichTextValue` object.
215
216
This is an immutable object that has the following properties.
216
217
217
218
`raw`
218
219
: A Unicode string with the original input markup.
219
220
220
221
`mimeType`
221
-
: The MIME type of the original markup, for example `text/html` or `text/structured`.
222
+
: The MIME type of the original markup, for example,`text/html` or `text/structured`.
222
223
223
224
`encoding`
224
225
: The default character encoding used when transforming the input markup.
The standard widget used for a `RichText` field will correctly store this type of object for you, so it is rarely necessary to create one yourself.
252
253
253
254
254
-
##### Using RichText fields in templates
255
+
##### `RichText` fields in templates
255
256
256
257
If you use a `DisplayForm`, the display widget for the `RichText` field will render the transformed output markup automatically.
257
258
If you write TAL manually, you may try something like the following.
@@ -280,7 +281,7 @@ This operation is approximately as efficient as rendering a simple `Text` field,
280
281
281
282
Sometimes, you may want to invoke alternative transformations.
282
283
Under the hood, the default implementation uses the `portal_transforms` tool to calculate a transform chain from the raw value's input MIME type to the desired output MIME type.
283
-
If you need to write your own transforms, take a look at [this tutorial](https://5.docs.plone.org/develop/plone/misc/portal_transforms.html).
284
+
If you need to write your own transforms, take a look at [Changing Portal Transforms Settings via Python](https://5.docs.plone.org/develop/plone/misc/portal_transforms.html).
284
285
This is abstracted behind an `ITransformer` adapter to allow alternative implementations.
285
286
286
287
To invoke a transformation in code, you can use the following syntax.
@@ -300,8 +301,8 @@ If you write a page template, there is an even more convenient syntax.
0 commit comments