Add the ability to filter by field type when creating a new field

Created on 5 July 2024, 6 months ago

Problem/Motivation

The UI to create fields is a great improvement and works really great providing extra information to end users about the different possibilities when creating a new field.

However, for big sites that has multiple contrib & custom modules that provide new field types, this page can become not easy to manage. Finding the expected field type to create can be challenging for site admins, like in the example below:

Would be great if Drupal could provide a system to allow to filter the field types, as we have in other places, like the modules or the permissions page.

Steps to reproduce

  1. Install a Drupal site
  2. Enable multiple modules that provide a field type
  3. Try to create a field type for a given content type, like https://example.com/admin/structure/types/manage/article/fields/add-field
  4. Confirm that it is not easy to find the field type to create.

Proposed resolution

Add an autocomplete filter that would allow to reduce the possibilities when creating a new field, making site editors life easier.
See demo:

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

โœจ Feature request
Status

Active

Version

11.0 ๐Ÿ”ฅ

Component
Field UIย  โ†’

Last updated 9 days ago

Created by

๐Ÿ‡ช๐Ÿ‡ธSpain plopesc Valladolid

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @plopesc
  • Status changed to Needs review 6 months ago
  • ๐Ÿ‡ช๐Ÿ‡ธSpain plopesc Valladolid

    Ceated MR with POC to confirm if the feature is considered and the approach valid.

  • Pipeline finished with Failed
    6 months ago
    Total: 160s
    #216694
  • Pipeline finished with Success
    6 months ago
    Total: 595s
    #216717
  • Status changed to RTBC 6 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia dishakatariya

    Hi, I have verified this issue on the D11 version. THis is working fine as expected.
    Testing steps:
    Install a Drupal site
    Enable multiple modules that provide a field type
    Try to create a field type for a given content type, like https://example.com/admin/structure/types/manage/article/fields/add-field
    Confirm that it is not easy to find the field type to create.

    Test Results:
    Appearing the ability to filter by field type when creating a new field

    Please refer the uploaded testing attachments.

    Hence it can be move to RTBC
    RTBC+1

  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany rkoller Nรผrnberg, Germany

    In general i like the idea, in particular in such a case described in the issue summary with that many field types available. One detail that probably could be made more clear is the label of the filter. Currently it says "Filter by field name or description". Technically not all of the available elements are fields types, but you also have groups for step one of the "add field" process (which currently is not visually apparent). so with this filter only the "stand alone" field types as well as the groups are being filtered, all the field types contained within the groups are not filtered nor available in this step. And it looks sort of unusual, first having the "Choose a type of field" label directly followed by the label of the filter field. on other pages that use a filter field those are usually wrapped within a fieldset/box, for example on /admin/people/permissions?

    In regards of consistency and usability, if you compare the filter with for example the filter on /admin/people/permissions, it is missing a clear button. Out of the scope for this issue, but probably relevant, problem with the clear button on the linked permissions page is that it is using a browser based clear button which leads to a differing experience across browsers. project browser has created a dedicated clear button for its search field which is not relying on any browser based clear button. i've opened an issue ( โœจ Add a clear button to the fields ui Active ) moving that clear button component into the field ui in core a few weeks ago.

  • Pipeline finished with Success
    6 months ago
    Total: 502s
    #221776
  • ๐Ÿ‡ช๐Ÿ‡ธSpain plopesc Valladolid

    Thank you for your suggestions.

    To make the UX more consistent with other pages like Permissions, moved the filter textfield into a fieldset container and changed the label to Filter"

  • Status changed to Needs work 6 months ago
  • ๐Ÿ‡ซ๐Ÿ‡ทFrance nod_ Lille

    I would really like to avoid having yet another filtering script (we already have at least 3 that do something similar in a different way).

    Can we do something based on โœจ Create Javascript library for searching rendered lists on the client. Needs work instead?

  • Status changed to Postponed 2 months ago
  • ๐Ÿ‡ช๐Ÿ‡ธSpain plopesc Valladolid
Production build 0.71.5 2024