Drupal8: Finding All FieldWidget Types

Whilst searching for an answer to a problem the other day I found a comment that details a command that prints out all of the FieldWidgets available in Drupal 8. This is useful if you are looking for all of the field widget classes in Drupal8.

Here is the command:

grep -rl '\@FieldWidget' | xargs grep -m1 'id = ' | grep -o FieldWidget.*

This prints out something similar to the following:

FieldWidget/TimestampDatetimeWidget.php: *   id = "datetime_timestamp",
FieldWidget/EmailDefaultWidget.php: *   id = "email_default",
FieldWidget/OptionsSelectWidget.php: *   id = "options_select",
FieldWidget/StringTextareaWidget.php: *   id = "string_textarea",
FieldWidget/UriWidget.php: *   id = "uri",
FieldWidget/StringTextfieldWidget.php: *   id = "string_textfield",
FieldWidget/LanguageSelectWidget.php: *   id = "language_select",
FieldWidget/NumberWidget.php: *   id = "number",
FieldWidget/BooleanCheckboxWidget.php: *   id = "boolean_checkbox",
FieldWidget/EntityReferenceAutocompleteWidget.php: *   id = "entity_reference_autocomplete",
FieldWidget/OptionsButtonsWidget.php: *   id = "options_buttons",
FieldWidget/EntityReferenceAutocompleteTagsWidget.php: *   id = "entity_reference_autocomplete_tags",
FieldWidget/LayoutBuilderWidget.php: *   id = "layout_builder_widget",
FieldWidget/ModerationStateWidget.php: *   id = "moderation_state_default",
FieldWidget/DateRangeDatelistWidget.php: *   id = "daterange_datelist",
FieldWidget/DateRangeDefaultWidget.php: *   id = "daterange_default",
FieldWidget/FileWidget.php: *   id = "file_generic",
FieldWidget/DateTimeDatelistWidget.php: *   id = "datetime_datelist",
FieldWidget/DateTimeDefaultWidget.php: *   id = "datetime_default",
FieldWidget/CommentWidget.php: *   id = "comment_default",
FieldWidget/PathWidget.php: *   id = "path",
FieldWidget/TestTextfieldWidget.php: *   id = "field_plugins_test_text_widget",
FieldWidget/TestFieldWidget.php: *   id = "test_field_widget",
FieldWidget/TestFieldWidgetMultipleSingleValues.php: *   id = "test_field_widget_multiple_single_value",
FieldWidget/TestFieldWidgetMultiple.php: *   id = "test_field_widget_multiple",
FieldWidget/TestFieldWidgetMultilingual.php: *   id = "test_field_widget_multilingual",
FieldWidget/DummyAjaxWidget.php: *   id = "image_module_test_dummy_ajax_widget",
FieldWidget/ImageWidget.php: *   id = "image_image",
FieldWidget/TelephoneDefaultWidget.php: *   id = "telephone_default",
FieldWidget/ShapeOnlyColorEditableWidget.php: *   id = "shape_only_color_editable_widget",
FieldWidget/LinkWidget.php: *   id = "link_default",
FieldWidget/MediaLibraryInceptionWidget.php: *   id = "media_library_inception_widget",
FieldWidget/MediaLibraryWidget.php: *   id = "media_library_widget",
FieldWidget/TextareaWithSummaryWidget.php: *   id = "text_textarea_with_summary",
FieldWidget/TextfieldWidget.php: *   id = "text_textfield",
FieldWidget/TextareaWidget.php: *   id = "text_textarea",
FieldWidget/OEmbedWidget.php: *   id = "oembed_textfield",
FieldWidget/ViewsReferenceSelectWidget.php: *   id = "viewsreference_select",
FieldWidget/ViewsReferenceWidget.php: *   id = "viewsreference_autocomplete",
FieldWidget/EntityReferenceBrowserWidget.php: *   id = "entity_browser_entity_reference",
FieldWidget/FileBrowserWidget.php: *   id = "entity_browser_file",
FieldWidget/MetatagFirehose.php: *   id = "metatag_firehose",
FieldWidget/RedirectSourceWidget.php: *   id = "redirect_source",
FieldWidget/PanelizerWidget.php: *   id = "panelizer",
FieldWidget/ImageCropWidget.php: *   id = "image_widget_crop",
FieldWidget/EntityReferenceRevisionsAutocompleteWidget.php: *   id = "entity_reference_revisions_autocomplete",
FieldWidget/InlineParagraphsWidget.php: *   id = "entity_reference_paragraphs",
FieldWidget/ParagraphsWidget.php: *   id = "paragraphs",
FieldWidget/VideoTextfield.php: *   id = "video_embed_field_textfield",
FieldWidget/InlineEntityFormComplex.php: *   id = "inline_entity_form_complex",
FieldWidget/InlineEntityFormSimple.php: *   id = "inline_entity_form_simple",

In osx the command is slightly different, but prints the same result.

grep -rl '\@FieldWidget' * | xargs grep -0 ' id = ' | grep -oE 'FieldWidget.*'

 

Add new comment

The content of this field is kept private and will not be shown publicly.
CAPTCHA
13 + 1 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.