Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Views filter select

Security covered Maintenance fixes only 455 sites

Part of the Views ecosystem · 287 projects

This module allows you to change a views exposed filter widget to a select dropdown list through code. This is useful for custom database tables where you want to provide a dropdown of existing values instead of a text input.

Adds a views filter select option.

This module allows you to alter a views data field exposed filter widget to be displayed as a select (dropdown) through code only. Can come in handy for custom database tables for selecting existing values instead of using the default textbox input field as an exposed filter.
Use hook_views_data_alter to change the filter id to "dropdownlist".

Used in https://www.drupal.org/project/search_api_tracking admins view.
Then this will generate something like the sort order in the following screenshot:

Usage

  $data['search_api_tracking_stats']['sort_order'] = [
    'title' => t('Sort order'),
    'field' => [
      'id' => 'standard',
    ],
    'filter' => [
      'id' => 'dropdownlist',
    ],
  ];

Note: "id=> dropdownlist".
This wille make the items appear in a dropdownlist.

This module doesn't do anything else must be addressed via code (views.inc - see above)

Drupal 9–11

Ask your assistant about Views filter select

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

  • views Drupal core

Required by

1 tracked project depends on this one

Activity

Tracked releases
3
Tracked since
May 2023
Latest release
3 months ago
Releases (12 mo)
1 ▲ from 0
Maintenance
Active

Release Timeline

Releases

Version Type Core PHP Release date
1.0.2 Stable 9–11 Aug 11, 2026
1.0.1 Stable 8–10 Jan 25, 2024
1.0.x-dev Dev 10–11 May 16, 2023