Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: OpenID Connect / OAuth client 3.0.0-alpha9 New alpha version released for module openid_connect (3.0.0-alpha9). Release: Timelinr 1.0.1 Minor update available for module timelinr (1.0.1). Usage Milestone: Simplify Module simplify crossed 10,000 active installs. Usage Milestone: Views Reference Filter Module entityreference_filter crossed 10,000 active installs. Usage Milestone: Dropdown Language Module dropdown_language crossed 10,000 active installs. Usage Milestone: Paragraphs Browser Module paragraphs_browser crossed 10,000 active installs. Usage Milestone: OpenAPI Module openapi crossed 10,000 active installs. Usage Milestone: Decoupled Router Module decoupled_router crossed 10,000 active installs. Usage Milestone: Time Field for Drupal 8+ Module time_field crossed 10,000 active installs. Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

Views autocomplete API

158 sites Security covered Drupal 10–11 Views ecosystem
View on drupal.org

This module allows you to populate any autocomplete text field with data generated by Views. It works particularly well with Views built on the Search API module and allows you to customize the displayed results and filtering through exposed filters.

This module allows you to populate any autocomplete textfield via Views driven data and as little coding as possible. This is a tiny module. It is known to work with views built on top of Search API module.

This module does not package any style for now. Screenshot is an example of result you can achieve after some CSS work. Of course, we would be happy to include any provided style proposed in the issue queue !

Usage

1 - Create one or more views :

  • The last field of the View is used to show the proposed results. You can rewrite results to combine multiple fields (images, links, texts, etc.)
  • The field before will be used for injection on selection and should be plain text (you can rewrite the field as well)
  • You can use header / footer and no result behavior.
  • The exposed filters will be used to filter the view with the input of the user into the autocomplete text field (you can user AND / OR, so for example seach on users the name or email). You can still use non-exposed filters to restrict the search.
  • You can use [autocomplete] token that contains the current search input

2 - Just do a little form_alter against any textfield element :

$form['my_text_field']['#autocomplete_route_name'] = 'views_autocomplete_api';
$form['my_text_field']['#autocomplete_route_parameters'] = [
  'view_name' => 'my_view_name1,my_view_name2,...'
];

Note that the master display of the Views will be used.

Views Autocomplete Search is a good example for testing some of those functionalities applied to the search field of the core default search block.

Differences with the D7 version : you can use [autocomplete] token wherever you are (for example in the header of the View to link to a research page). Drupal 8 version supports highlighting as well.

Alternative modules:

Search Autocomplete : uses Views as well to generate autocomplete path.

Depends on

Dependencies of the latest stable release

  • views Drupal core

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
1
Tracked since
Oct 2025
Latest release
10 months ago
Releases (12 mo)
1 ▲ from 0
Maintenance
Slowing

Releases

Version Type Core Release date
2.1.0 Stable 10–11 Oct 28, 2025