Problem/Motivation
Drupal 8 introduces a number of new renderable form elements and removes a few. Form API documentation must be updated with these changes.
In a first attempt to collect all form elements, I took all elements which are used in '#type' => '...'.
Added in D8
Input elements
- color
- datelist
- datetime
- language_configuration
- number
- range
- search
- table
- tel
- url
Other elements
- ajax *
- contextual_links *
- contextual_links_placeholder
- dropbutton
- fieldgroup
- field_ui_table *
- html
- html_tag *
- label
- link *
- operations
- render_cache_placeholder
- scripts
- styles *
- toolbar
- toolbar_item
- view
Other:
*) Already used in D7, but not included in D7 Form API reference.
Done
- details
- language_select
Deleted in D8
- Form
- Markup
A discussion was started about where to document 'link', but would apply to some other types as well: #1190658: Where to document the link element (and future Render elements)?.
Proposed resolution
* Write documentation
* Decide which render array types shall be documented in Form API reference. Discussion at: #1190658: Where to document the link element (and future Render elements)?.
Remaining tasks
t.b.d.
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | documentation-fapi8-2220415-12.patch | 219.19 KB | sutharsan |
| #12 | interdiff-2220415-11-12.txt | 49.14 KB | sutharsan |
Comments
Comment #1
sutharsan commentedAdding tag
Comment #2
leehunter commentedComment #3
leehunter commentedComment #4
sutharsan commentedRemoved type 'remote'. It does not exist.
Comment #5
sutharsan commentedThis patch adds default values of the new elements.
Comment #6
sutharsan commentedComment #7
sutharsan commentedAdded documention for types: color, datalist, datetime, email.
Comment #8
sutharsan commentedChanged the issue summary to separate the input elements from the rest. I'm give priority to documenting the input elements.
Still needs discussion where we should document the 'other' elements, should they be included in the Form API Reference page or not? Anyone?
Comment #9
sutharsan commentedAdded 'number', 'range', search'.
Comment #10
sutharsan commentedModified 'tableselect' to 'table'. The code of '#table' is still in flux, so the example and perhaps the documentation may change in the future.
Comment #11
sutharsan commentedAdded 'tel' and 'url'.
Comment #12
sutharsan commentedAdded/modified all attributes related to the new input elements: 'date_date_callbacks', 'date_date_element', 'date_date_format', 'date_format_string_type', 'date_increment', 'date_part_order', 'date_timezone', 'date_time_callbacks', 'date_time_element', 'date_time_format', 'date_year_range', 'languages', 'max', 'min', 'responsive', 'step', 'sticky', 'tabledrag', 'tableselect'.
Documenting the input elements was much more work that I expected. Lets review and complete this first, before moving on to the other elements.
Comment #13
jhodgdonComment #14
jhodgdonComment #15
jhodgdonWe are actually documenting form/render elements on #2486967: [meta] Move/Create Form Element Documentation and its child issues.