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.

View Entity Reference Field Formatter

This (small) Module allows you to use a view to display an entity or entities for an entity_reference field display.

core ships right now with the entity_reference field formatters
Entity ID
RSS category
Label
and ...
Rendered entity
"Rendered entity" is cool because we can use display modes as settings...
however this is not 100% exactly what we need some times and would't it be cool to be able to use the views module to display the referenced entities ... this module does just that.

This will work with any referenced entity type that is supported by views !!!

you need a view with a CONTEXTUAL FILTER of the ENTITY ID that the field has referenced

A How TO Example

Lets say you have a Standard Drupal 8 install with Article, this content type ships with the field "field_tags"
which is an entity reference field. which references the vocabulary tags.

Enable this module...
then goto (content types > article -> manage display mode )
"admin/structure/types/manage/article/display" and see
for field Tags change the formatter to "Views render entity ref field formatter"
click the settings cog

enter the machine name of the view (the view_id) you want to use and the display (or just use default)
and save.

Example view configuration
admin/structure/views/add

crate new view of with settings Show (Taxonomy Terms) of type Tags and save ...

(I called mine Article Tags Display)
at this point you can look at the url to get the View Id to use in the field formatter settings.
example /admin/structure/views/view/article_tags_display

note by default its showing all the terms on the site, we don't want that so goto

ADVANCED -> CONTEXTUAL FILTERS -> add
select "Term ID" or if not using taxonomy term use the corresponding (entity id) field..
WHEN THE FILTER VALUE IS NOT AVAILABLE
select Provide default value,
and for Type select Fixed value
and for Fixed value enter "0" (Zero)
go down to MORE and select "Allow multiple values"

after that and you have entered the view id in to the field formatter you are good to go.

After all that edit your view to be exactly what you want.

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
1
Tracked since
Sep 2023
Latest release
3 years ago
Releases (12 mo)
0
Maintenance
Dormant

Releases

Version Type Core Release date
8.x-1.2 Stable Sep 3, 2023