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). Usage Milestone: Google Analytics Module google_analytics crossed 1,000 active installs. Release: Timelinr 1.0.1 Minor update available for module timelinr (1.0.1). Release: GraphQL Compose Codegen 1.1.2 Minor update available for module graphql_compose_codegen (1.1.2). Release: Mapy.com 1.1.3 Minor update available for module mapycom (1.1.3). Release: Ckeditor5 entity browser 3.0.3 Minor update available for module ckeditor5_entity_browser (3.0.3). Release: Ckeditor5 entity browser 3.0.1 Minor update available for module ckeditor5_entity_browser (3.0.1). Release: Ckeditor5 entity browser 3.0.2 Minor update available for module ckeditor5_entity_browser (3.0.2). Release: Teamleader Integration 4.0.2 Minor update available for module teamleader (4.0.2). Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

This module allows you to add a custom text field alongside your entity reference fields. This lets you override the referenced entity's title or text fields, add CSS classes, or change its display mode on a case-by-case basis. It's useful for customizing how referenced content appears when displayed in lists or aggregated pages.

An entity reference field paired with an accompanying text field. This custom text field on the referencing entity can be used to:

  • override the linked entity's title
  • override any text field or text area (including WYSIWYG) on the referenced entity
  • add an extra class to its rendered output, or
  • override the default display mode for the field on an entity-by-entity basis.

Use cases

  • You're building "related article" lists or aggregate pages that use entity references to pull in other articles, but you need to tweak the appearance of individual entities for contextual relevance or emphasis.
  • Give per-project job roles to people credited on a project.
  • Provide a contextually-relevant short bio for an author referenced from a piece of article content.

If you need it, you're feeling happy right now.

Post-Installation (Usage)

Go to the Manage fields tab of any fieldable entity, for example Administration » Structure » Content types » Article » Manage fields for the article content type. Press Add field, and using the Add a new field dropdown, scrolling to under Reference, select "Entity reference w/custom text", provide a label for your entity referencing field, and then press Save and continue.')

On the resulting page, select what type of item to reference and allowed number of values as you would for any entity reference field, and Save field settings.

Community Documentation

We have documentation started at Entity Reference Override documentation, edits and new pages there welcome!

Based on the approach of extending a field type in Drupal 8 by Lullabot's Matt Robison.

Similar Modules

See Media Library Media Modify for a better and more robust approach to referenced media.

If you do not need the secondary field to be an optional override of a value from the referenced entity, that is if you find yourself making a field that will never be used on the original content just to "override" it with this module, you are better off with the Custom Field module.

Supporting this Module

You can support Agaric's overall contributions to Drupal and a bit beyond by supporting Drutopia at opencollective.com/drutopia. Thanks!!

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
Jan 2025
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 2
Maintenance
Dormant

Releases

Version Type Core Release date
2.0.0-beta4 Pre-release 10–11 Apr 11, 2025
2.0.0-beta3 Pre-release 10–11 Jan 21, 2025