Skip to content

Commit dcdb33b

Browse files
committed
add section to forms: Disable form tabbing
1 parent 04eb0c8 commit dcdb33b

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

docs/classic-ui/forms.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,3 +101,50 @@ class MyForm(AutoExtensibleForm, form.EditForm):
101101

102102
Dexterity content types are coming with default add and edit forms.
103103
You can build custom add and edit forms if you need.
104+
105+
### Disable form tabbing
106+
107+
To disable the form tabbing, you have to override the form and provide a property enable_form_tabbing which is False.
108+
109+
The Python code `custom_edit_form.py` should look like this:
110+
111+
```python
112+
class ICustomEditForm(Interface):
113+
"""
114+
"""
115+
116+
@implementer(ICustomEditForm)
117+
class CustomEditForm(edit.DefaultEditForm):
118+
""" Custom edit form disabling form_tabbing
119+
"""
120+
enable_form_tabbing = False
121+
122+
```
123+
124+
to activate it, you have to override the registration of the edit form for your desired content types.
125+
In your configure.zcml:
126+
127+
```xml
128+
<configure
129+
xmlns="http://namespaces.zope.org/zope"
130+
xmlns:browser="http://namespaces.zope.org/browser"
131+
i18n_domain="example.contenttypes">
132+
133+
<!-- for TTW CT's -->
134+
<browser:page
135+
name="edit"
136+
for="plone.dexterity.interfaces.IDexterityContainer"
137+
class=".custom_edit_form.CustomEditForm"
138+
permission="cmf.ModifyPortalContent"
139+
layer="example.contenttypes.interfaces.IExampleContenttypesLayer"
140+
/>
141+
142+
<browser:page
143+
name="edit"
144+
for="example.contenttypes.content.technical_facility.ITechnicalFacility"
145+
class=".custom_edit_form.CustomEditForm"
146+
permission="cmf.ModifyPortalContent"
147+
layer="example.contenttypes.interfaces.IExampleContenttypesLayer"
148+
/>
149+
</configure>
150+
```

0 commit comments

Comments
 (0)