Better Entity Reference - Drupal module
Better Entity Reference demo (gif)

Better Entity Reference replaces Drupal's default widgets for entity reference, list, media, file and image fields with a tag- and tile-based interface. Selected items show as removable, reorderable tags or thumbnail tiles, and a round "+" opens a popover to search, browse, upload and pick. The reference widgets store values through core's own input, so they fall back to the standard autocomplete when JavaScript is unavailable.

Key features

  • Five widgets: Better Entity Reference (entity reference fields, any selection handler including views), Better Options (list text/integer/float fields), Better Media (media fields), and Better File / Better Image (file and image fields).
  • Popover toolbar: search (contains or starts with), sort by name or date, a Filter by type and publication status, Glossary letter grouping and a Parent terms first toggle - collected in a collapsible toolbar beside the search box and remembered per browser.
  • Upload inside the widget: the file, image and media widgets chunk-upload files through the module's own endpoint, honoring the field's extensions and size limits with a progress bar per file. Media auto-detects the type from the file and also accepts remote/oEmbed video.
  • File Browser: instead of uploading, pick from existing files, images or media with search, sorting, a type filter, list or grid view and paging - with an Upload view one click away, and an option to show only the current user's own files.
  • Folder browsing & live search: drill hierarchical vocabularies level by level with a breadcrumb and per-folder counts (loaded on demand); other and views-driven fields search through the field's own selection handler.
  • Reorder & quick create: drag or use the arrow keys to reorder (the order is saved); auto-create fields show a "+ New" row that creates and picks in one step, with a type chooser when several bundles are allowed.
  • Tag colors: stable per-entity colors - Random, Shades of a main color, or One color - drawn as a Stroke or a Fill with readable text, overridable via an entity color field or hook_better_entity_reference_option_alter().
  • Tooltips, formatter, validation: rich tooltips (name, type, id, size, usage, publication status); the Better Tags formatter inheriting the widget colors; and visible validation - required warnings, red marks on refused values, and cardinality limits that disable the "+".
  • Custom forms & accessibility: better_entity_reference and better_options form elements for your own forms, plus full keyboard support, ARIA roles and screen reader announcements.

Screenshots

Better Entity Reference - image, file and media reference fields

Better Entity Reference - long taxonomy reference field with search

Better Entity Reference - content reference with search

Better Entity Reference - taxonomy tags reference field

Better Entity Reference - media upload popover

Better Entity Reference - image or file upload popover

Better Entity Reference - clear all selection option

Configuration

  1. On the field's Manage form display, choose the widget for its type: Better Entity Reference, Better Options, Better Media, Better File or Better Image.
  2. Open the widget settings to configure the popover toolbar (search, sort, filter, glossary), display (colors or thumbnails, tooltips, confirm before removing) and - for file/image/media - whether the "+" opens Upload or the File Browser, and the page size.
  3. Optionally pick the Better Tags formatter on Manage display to render saved values as the same tags on the page.

Built with AI assistance

Project information

Releases