Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: Views Bootstrap 5.5.4 — Minor update available for module views_bootstrap (5.5.4). Release: Rightup theme 1.0.3 — Minor update available for theme vartheme_bs5_rightup (1.0.3). Release: CommentOn 1.0.6 — Minor update available for module commenton (1.0.6). Release: ChatGPT Ads 1.0.3 — Minor update available for module chatgpt_ads (1.0.3). Release: Opensolr Search 5.1.3 — Minor update available for module opensolr_search (5.1.3). Release: ServiceM8 Webform Integration 1.2.1 — Minor update available for module servicem8_webform (1.2.1). Release: PostfixAdmin 1.0.0 — Initial release available for module postfix_admin (1.0.0)! Release: ip_analyser 1.0.3 — Minor update available for module ip_analyser (1.0.3). Module Revived: Swagger-PHP OpenAPI 3 documentation generator 1.0.0 — Module swagger_php updated after 10 months of inactivity (1.0.0). Security Coverage: Microsoft Azure AI — Module ai_provider_azure now has official Drupal security advisory coverage.

The Straw (Super Term Reference Autocomplete Widget) module provides a new interface for associating taxonomy terms with content using a term reference field. It looks just like a normal placeholder select widget, but it shows the whole tag hierarchy when displaying existing values, and it shows and searches the whole hierarchy when finding matches for the autocomplete dropdown. If term creation is enabled, it also allows a new term to be created along with all of its parents that don't exist already by simply using the >> delimiter.

Requirements

At this time Straw can only be used with term reference fields. As such, the core taxonomy module must be enabled in order to make use of it.

Installation

Install this module via composer by running the following command:

composer require drupal/straw

Configuration

Configuring a field widget to use Straw requires two steps. First, in the settings for the field, choose the "Straw selection" reference method. Then, for the field widget settings on the Manage Form Display tab, choose "Autocomplete (Straw style)".

Basic usage

Once Straw is configured for a field, that field will show all the parents of the selected terms in addition to the term itself. Each level of the hierarchy is separated from the others by two right-facing arrows (>>), and if term creation is enabled for the field, these same separators can also be used between levels of the hierarchy when typing in a new term, and all terms in the hierarchy that don't already exist will get created. For instance, entering "Travel >> Tourist Destinations" will create two terms, "Travel" and "Tourist Destinations", with the latter as a child of the former.

Credits

Module development is sponsored by Ashday Interactive Systems.

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
2
Tracked since
Jun 2024
Latest release
2 years ago
Releases (12 mo)
0
Maintenance
Dormant

Releases

Version Type Core Release date
2.0.0-beta1 Pre-release Jun 1, 2024
2.x-dev Dev Jun 1, 2024