UX improvement: use autocomplete for entity selection in area handlers

Created on 27 June 2016, about 9 years ago
Updated 31 July 2025, about 2 months ago

Problem/Motivation

When adding an area of type "Rendered entity - *" in Views you have to manually enter the ID of the entity to add. This is not very intuitive.

Proposed resolution

Change the field to an autocomplete so the user can search for the entity.

Remaining tasks

User interface changes

The input field of the area handlers for "Rendered entity" will change to an autocomplete.

API changes

none

Data model changes

none

✨ Feature request
Status

Postponed: needs info

Version

11.0 πŸ”₯

Component

views.module

Created by

πŸ‡©πŸ‡ͺGermany stborchert

Live updates comments and jobs are added and updated live.
  • stale-issue-cleanup

    To track issues in the developing policy for closing stale issues, [Policy, no patch] closing older issues

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Thank you for sharing your idea for improving Drupal.

    We are working to decide if this proposal meets the Criteria for evaluating proposed changes. There hasn't been any discussion here for over 8 years which suggests that this has either been implemented or there is no community support. Your thoughts on this will allow a decision to be made.

    Since we need more information to move forward with this issue, the status is now Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.

    Thanks!

  • πŸ‡ΊπŸ‡ΈUnited States dww

    There has been no solution to this problem. It's a UX improvement in a somewhat obscure feature of core that I imagine is relatively rarely used. But the current feature still has the same problem as clearly described in the issue summary. If you want to attach a rendered entity to a Views area (header, footer, etc), you have to manually type in the entity ID. See attached screenshot. This is not intuitive. An autocomplete would be better.

  • πŸ‡©πŸ‡ͺGermany stborchert

    Seems I have to reroll my patch 😁

  • πŸ‡©πŸ‡ͺGermany stborchert

    This seems to be much more complicated as I thought initially. Simply changing this input to an (entity) autocomplete wan't work because the field also accepts tokens and twig syntax.
    I tried conditionally to disable the autocomplete validation but that doesn't work. If you enter a token or twig markup EntityAutocomplete::matchEntityByTitle() fails with error There are no @entity_type_plural matching "%value". because strict checking is always TRUE for autocomplete fields that do not have the autocreate option set to TRUE.

    A possible way to solve this would be a custom autocomplete handler based on EntityAutocomplete that overrides ::matchEntityByTitle() (simply returning NULL) but that seems not to be the best solution.

    Any thoughts about this?

Production build 0.71.5 2024