Drupal is a registered trademark of Dries Buytaert
Release: Excel Serialization 2.1.2 Minor update available for module xls_serialization (2.1.2). Release: Time Zone Field 8.x-1.14 Minor update available for module tzfield (8.x-1.14). Module Revived: Entity API 8.x-1.7 Module entity updated after 17 months of inactivity (8.x-1.7). Release: Vartheme Bs5 4.1.1 Minor update available for theme vartheme_bs5 (4.1.1). Release: Varbase Heroslider 1.1.3 Minor update available for module varbase_heroslider (1.1.3). Release: Varbase Demo 1.1.2 Minor update available for module varbase_demo (1.1.2). Release: Varbase Dashboards 2.0.3 Minor update available for module varbase_dashboards (2.0.3). Release: Varbase AI 2.0.9 Minor update available for module varbase_ai (2.0.9). Release: Varbase Workflow 3.1.2 Minor update available for module varbase_workflow (3.1.2). Security Coverage: Role Aware Maxlength Module role_aware_maxlength now has official Drupal security advisory coverage.

This module enhances the entity reference autocomplete widget by combining "starts with" and "contains" search logic. It displays results that start with your search term first, followed by results that contain the term elsewhere in the text, improving usability for fields with many potential entries.

This module provides an autocomplete widget for entity reference fields that combines "STARTS_WITH" and "CONTAINS" matching.
Other than that, the widget behaves exactly like the one from Drupal core.

The result has all the matches that start with the search string, followed by matches that only contain the search string but that don't start with it.

Features

Comparison with core entity autocomplete widget.

Search term Limit Core
STARTS_WITH Core
CONTAINS New:
Mixed matching "Frog" 3 Frog
Frog eggs 99 frogs
Acrobatic frog
Cyan frog Frog
Frog eggs
99 frogs “Frog” 1 Frog 99 frogs Frog “egg” 3 - Frog eggs Frog eggs

Use case

The main use case are reference fields with a large number of potential targets.
In these cases neither the "CONTAINS" nor the "STARTS_WITH" mode are completely suitable:

  • For "STARTS_WITH", there may be no results, if all the items start with a prefix like "The ..." or a number.
  • For "CONTAINS", the exact match may never show up, because the list is filled up with less relevant matches.

Post-Installation

Configure any entity form display, use the widget for an entity reference field.

Activity

Tracked releases
2
Tracked since
Sep 2025
Latest release
11 months ago
Releases (12 mo)
2 ▲ from 0
Maintenance
Slowing

Releases

Version Type Release date
1.1.0 Stable Sep 8, 2025
1.1.0-alpha1 Pre-release Sep 3, 2025