Skip to content

Commit aae510a

Browse files
committed
Fix cross-references, and tidy up forms.md
1 parent 29f89eb commit aae510a

File tree

2 files changed

+14
-18
lines changed

2 files changed

+14
-18
lines changed

docs/backend/schemas.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ Note this won't have behavior fields added to it at this stage, only the fields
219219

220220
(backend-schemas-directives-label)=
221221

222-
## Using schema directives
222+
## Schema directives
223223

224224
With `plone.autoform` and `plone.supermodel`, we can use directives to add information to the schema fields.
225225

docs/classic-ui/forms.md

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@ schema = IMyForm
120120
If your form is not bound to an object (such as a Dexterity object), set `ignoreContext = True`.
121121

122122

123-
(classic-ui-forms-autoform-label)=
123+
(classic-ui-controlling-form-presentation-label)=
124+
124125
## Controlling form presentation
125126

126127
Directives can be specified in the schema to control aspects of form presentation.
@@ -130,25 +131,18 @@ Directives can be specified in the schema to control aspects of form presentatio
130131
See the corresponding chapters to learn how to control field and widget presentation in a form.
131132

132133
```{seealso}
133-
{ref}`Field permission <backend-fields-schema-label>`
134-
```
135-
```{seealso}
136-
{ref}`Ordering, omitting, grouping <backend-schemas-directives-label>`
137-
```
138-
```{seealso}
139-
{ref}`Changing a field's display mode <backend-widgets-fields-display-label>`
140-
```
141-
```{seealso}
142-
{ref}`Changing a field's widget <backend-widgets-fields-widget-label>`
134+
- {ref}`backend-fields-schema-autoform-permission`
135+
- {ref}`backend-schemas-directives-label`
136+
- {ref}`backend-widgets-change-a-fields-display-label`
137+
- {ref}`backend-widgets-change-a-fields-widget-label`
143138
```
144139

145140

146141
### Display Forms
147142

148-
149143
Sometimes rather than rendering a form for data entry, you want to display stored values based on the same schema.
150144
This can be done using a "display form".
151-
The display form renders each field's widget in "display mode" which means that it shows the field value in read-only form rather than as a form input.
145+
The display form renders each field's widget in "display mode", which means that it shows the field value in read-only form rather than as a form input.
152146

153147
To use the display form, create a view that extends `WidgetsView` like this:
154148

@@ -158,17 +152,19 @@ from plone.autoform.view import WidgetsView
158152
class MyView(WidgetsView):
159153
schema = IMySchema
160154
additionalSchemata = (ISchemaOne, ISchemaTwo,)
161-
162-
# ...
163155
```
164156

165157
To render the form, do not override `__call__()`.
166158
Instead, either implement the `render()` method, set an `index` attribute to a page template or other callable, or use the `template` attribute of the `<browser:page />` ZCML directive when registering the view.
167159

168160
In the template, you can use the following variables:
169161

170-
- `view/w` is a dictionary of all widgets, including those from non-default fieldsets (by contrast, the `widgets` variable contains only those widgets in the default fieldset). The keys are the field names, and the values are widget instances. To render a widget (in display mode), you can do `tal:replace="structure view/w/myfield/render" />`.
171-
- `view/fieldsets` is a dictionary of all fieldsets (not including the default fieldset, in other words, those widgets not placed into a fieldset. The keys are the fieldset names, and the values are the fieldset form instances, which in turn have variables like `widgets` given a list of all widgets.
162+
- `view/w` is a dictionary of all widgets, including those from non-default fieldsets.
163+
By contrast, the `widgets` variable contains only those widgets in the default fieldset.
164+
The keys are the field names, and the values are widget instances.
165+
To render a widget (in display mode), you can do `tal:replace="structure view/w/myfield/render" />`.
166+
- `view/fieldsets` is a dictionary of all fieldsets not including the default fieldset, in other words, those widgets not placed into a fieldset.
167+
The keys are the fieldset names, and the values are the fieldset form instances, which in turn have variables, such as `widgets`, given a list of all widgets.
172168

173169

174170
(classic-ui-forms-dexterity-add-edit-forms-label)=

0 commit comments

Comments
 (0)