Tagify widget¶
The Tagify widget (tagify_entity_reference_autocomplete_widget) replaces
the autocomplete input of an entity reference field with a tags input. It
queries the field's selection handler as the editor types, so it respects the
target type, target bundles, sort, and autocreate settings of the field.
Enable it¶
- Go to Manage form display of the bundle, for example
/admin/structure/types/manage/article/form-display. - Pick Tagify as the widget of an entity reference field.
- Open the gear icon to change the settings below, then save.
To use the widget for every new entity reference field, enable Set Tagify widget as default under global settings.
Settings¶
| Setting | Default | Description |
|---|---|---|
| Autocomplete matching | Contains | Starts with or Contains. Contains can be slow on sites with thousands of entities. |
| Number of results | 10 | How many suggestions the dropdown lists. 0 removes the limit. |
| Suggestions dropdown | When 1 character is typed | On click opens the list when the input gets focus; When 1 character is typed waits for input. |
| Placeholder | empty | Text shown in the empty input. |
| Include entity id | off | Adds the entity ID to each tag. |
| Include info label | off | Shows a second value inside each tag. See Info label. |
| Info label content | empty | Token template for the info label. Shown when the info label is on. |
| Parent selection | on | Taxonomy only. When off, top level terms that have children cannot be selected; only their children can. |
Behavior¶
- Cardinality: a single value field accepts one tag. A limited cardinality field stops accepting tags at the limit.
- Autocreate: when the field's reference settings allow creating referenced entities, typed values that match nothing become new entities on save, in the bundle set by the field.
- Reordering: on multi value fields, tags can be dragged to change their order. The widget adds a "Drag to re-order" hint to the field description.
- Hierarchy: suggestions for terms in a hierarchical vocabulary carry the name of the parent term, so terms with the same name under different parents can be told apart.
- Embedded forms: the widget gets a unique identifier per delta, so it works inside Paragraphs and other nested forms.