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
  • email
  • 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.

Comments

sutharsan’s picture

Issue summary: View changes
Issue tags: +FAPI reference

Adding tag

leehunter’s picture

Issue tags: -FAPI reference +FAPI reference d8docs
leehunter’s picture

Issue tags: -FAPI reference d8docs +d8docs
sutharsan’s picture

Issue summary: View changes

Removed type 'remote'. It does not exist.

sutharsan’s picture

Status: Active » Needs work
StatusFileSize
new7.4 KB

This patch adds default values of the new elements.

sutharsan’s picture

Assigned: Unassigned » sutharsan
sutharsan’s picture

Status: Needs work » Needs review
StatusFileSize
new63.88 KB
new56.85 KB

Added documention for types: color, datalist, datetime, email.

sutharsan’s picture

Issue summary: View changes

Changed 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?

sutharsan’s picture

StatusFileSize
new109.52 KB
new57.66 KB

Added 'number', 'range', search'.

sutharsan’s picture

StatusFileSize
new154.81 KB
new66.44 KB

Modified 'tableselect' to 'table'. The code of '#table' is still in flux, so the example and perhaps the documentation may change in the future.

sutharsan’s picture

StatusFileSize
new171.79 KB
new55.32 KB

Added 'tel' and 'url'.

sutharsan’s picture

Assigned: sutharsan » Unassigned
StatusFileSize
new49.14 KB
new219.19 KB

Added/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.

jhodgdon’s picture

jhodgdon’s picture

Component: Missing documentation » API documentation files
Issue tags: +FAPI reference
jhodgdon’s picture

Status: Needs review » Closed (duplicate)
Related issues: +#2486967: [meta] Move/Create Form Element Documentation

We are actually documenting form/render elements on #2486967: [meta] Move/Create Form Element Documentation and its child issues.