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/widgets.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ myst:
15
15
See the chapter {doc}`training:mastering-plone/dexterity_reference` from the Mastering Plone 6 Training.
16
16
```
17
17
18
-
Widgets render HTML code for input and parse HTTP `post` request input in Plone.
18
+
Widgets render HTML code for input and parse the input from an HTTP `post` request in Plone.
19
19
20
20
Plone stores widgets as the `widgets` attribute of a form.
21
21
Plone presents widgets as an ordered dict-like `Widgets` class.
@@ -30,8 +30,9 @@ When an HTTP `post` request comes in, Zope publisher automatically converts `<se
30
30
31
31
## Widget reference
32
32
33
-
```{note}
34
-
In VS Code editor, you can install the [Plone Snippets](https://marketplace.visualstudio.com/items?itemName=Derico.plone-vs-snippets) extension. This will give you snippets for most fields, widgets and autoform directives in Python and XML based schemas.
33
+
```{tip}
34
+
In VS Code editor, you can install the [Plone Snippets](https://marketplace.visualstudio.com/items?itemName=Derico.plone-vs-snippets) extension.
35
+
This will give you snippets for most fields, widgets, and autoform directives in Python and XML based schemas.
35
36
```
36
37
37
38
You can find the default widgets in the browser package in `z3c.form`.
@@ -61,6 +62,7 @@ The main widgets are:
61
62
- Time Widget
62
63
- DateTime Picker
63
64
65
+
64
66
## Changing a field's widget
65
67
66
68
You can change the widget that you use for a field in several ways.
@@ -74,7 +76,7 @@ This model is defined as a `zope.schema` based schema, but extra hints can be su
74
76
75
77
By default, `z3c.form` picks a widget based on the type of your field.
76
78
You can change the widget using the `widget` directive if you want users to enter or view data in a different format.
77
-
For example, you can change the widget for the `human` boolean field to use "yes" and "no" radio buttons instead of its default checkbox:
79
+
For example, you can change the widget for the `human` boolean field to use `yes` and `no` radio buttons instead of its default checkbox:
78
80
79
81
```{code-block} python
80
82
:emphasize-lines: 7
@@ -513,7 +515,7 @@ You can override widget templates as instructed for `z3c.form`.
513
515
You might want to customize this widget frame for your own form.
514
516
Below is an example of how to do it.
515
517
516
-
Copy [`widget.pt`](https://github.com/plone/plone.app.z3cform/blob/master/plone/app/z3cform/templates/widget.pt) to your own package, rename it as ``demo-widget.pt`` and edit it.
518
+
Copy [`widget.pt`](https://github.com/plone/plone.app.z3cform/blob/master/plone/app/z3cform/templates/widget.pt) to your own package, rename it as `demo-widget.pt`, and edit it.
517
519
518
520
Then add the following code to `configure.zcml`.
519
521
Remember to fix the path of the template according to your own paths.
@@ -555,7 +557,7 @@ class MyForm(...):
555
557
556
558
## Combined widgets
557
559
558
-
You can combine several widgets into one with `z3c.form.browser.multil.MultiWidget` and `z3c.form.browser.object.ObjectWidget` classes.
560
+
You can combine several widgets into one with `z3c.form.browser.multi.MultiWidget` and `z3c.form.browser.object.ObjectWidget` classes.
559
561
560
562
The following example shows how to create an input widget with minimum and maximum values.
561
563
@@ -570,9 +572,7 @@ from z3c.form.object import registerFactoryAdapter
0 commit comments