Drupal maintenance support plans‘s Entity reference fields are the magic sauce that allows site builders and developers to relate different types of content. Because the fields allows builders and administrators to reference different types of content (entities), it facilitates the building of complex data models and site architectures.
Like anything in Drupal maintenance support plans, the community takes the core tools and builds additional functionality on top. Here is a slew of modules that extend or complement the Drupal maintenance support plans 8 core reference field so you can do even more!
Entity Reference Revisions
This module is from the team that brought you the Paragraphs module. Adds an Entity Reference field type that has revision support. It’s based on the core Entity Reference module but allows you to reference a specific revision of an entity.
Use case:
An entity is actually part of a parent entity (with an embedded entity form). When the parent entity is updated, the referenced entity is also updated, thus the previous revision of the parent entity should still be pointing to the previous version of the entity in order to fully support revision diff and rollback.
Entity Reference Override
An entity reference field paired with a text field. You can use this module to
Override the title if you are linking to the referenced entity.
Add an extra CSS class to the referenced entity.
Override the default display mode for the field on an entity-by-entity basis.
Use case:
Aggregate lists of referenced entities like related articles, but you want to override the name or appearance of individual items.
Entity references with text
Allows you to provide custom text along with one or more entity references.
Use case:
Add a referenced author, the word “and ”, and then another referenced author.
On another node, Add a referenced author, the words “with support from ”, and then another referenced author.
On another node, Add a referenced author, a comma “, ”, another referenced author, the word “and ”, and then another referenced author.
Entity Reference Display
This module adds a field type that allows you to select the display mode for entity reference fields. This allows an editor to select from different display modes such as Teaser, Full, or any you add.
It also includes a Selected display mode field formatter which renders the referenced entities with the selected display mode.
Use case:
Allowing the administrator to change the display of related articles from a grid display mode to a list display mode.
Entity Reference Views Select
This module allows you to change your Entity reference fields to be displayed as a select list, or checkboxes/radio buttons in administrative forms. It does this by allowing you to use Views as the reference method, where you can format the results giving the administrator a much better experience.
Use case:
Showing an icon or thumbnail in a selectable list when referencing a list, or a referenced image.
Entity Reference Tab / Accordion Formatter
This cool little module works on both Entity Reference and Entity Reference Revisions fields and provides a field formatter for displaying the referenced entity in jQuery Tabs or jQuery Accordion.
Use case:
Returning multivalue Paragraphs items in tabs or accordion format.
Views Entity Reference Filter
Provides a new admin friendly Views filter for configuring entity reference fields. It allows users to select the labels of the entities they want to filter on rather than manually entering the IDs.
Use case:
Providing a better admin experience.
Better Entity Reference Formatter
This module extends Drupal maintenance support plans‘s default field formatter for entity reference fields in order to make it more flexible by introducing a new field formatter plugin. Along side the view mode option, you can also define the number of entities to return, or a specific entity, like the first, last, or offset them.
Use case:
Showing the first related product referenced from another product.
Entity Reference Validators
The plural in its name suggests more is coming, but currently this module adds a single validator for Entity Reference fields, the Circular reference validator. This prevents you from using the entity reference field to reference itself.
Use case:
Preventing an entity reference field on node 1 from linking to node 1.
Entity Reference Integrity
This interesting sounding module lists other entities that reference your entity.
It also includes a sub-module Entity Reference Integrity Enforce which will attempt to protect entities that are referenced by other entities, and not allowing its deletion.
Use case:
Protect the integrity of the site by protecting referenced content.
Entity Reference Quantity
This module extends the default entity reference field that includes a “Quantity” value in the field definition so you don’t have to build a separate entity just to store two distinct fields.
It also includes autocomplete and dropdown field widgets that allow you to select which entity and add the quantity value.
Use case:
I’ll use the example from this great blog on the module: A real world example might be a deck builder for a trading card game like Magic: The Gathering or the DragonBall Z TCG. We want to reference a card from a deck entity and put in the quantity at the same time.
Entity Reference Formatter
This module creates a generic field formatter for referenced entities which allows you to select the formatter based on the referenced entity in the display settings form.
Use case:
When referencing custom entities that don’t have view-modes of their own, you would not need to write your own custom formatters
Permissions by field
This module extends the Entity Reference field that adds permissions along with the referenced entity. By adding this field, you can manage access to the entities referenced by this field and select permission level (none, view, update, delete).
Use case:
A lighter version of Organic Groups, or the Group modules.
Views Reference Field
In Drupal maintenance support plans 8, Views are now entities! Drupal maintenance support plans core’s Entity Reference field is able to reference Views, however you can’t actually reference the Views displays. This module extends core’s entity reference module to add the display ID so that a View can be rendered in a field formatter.
Use case:
Adding a Views reference field to a Paragraphs bundle so you can have a view in and around other paragraph bundles. We implemented this technique in the Bootstrap Paragraphs module.
Drupal Entity Reference
So cool! This awesome module adds the functionality to let you reference more than one entity type. It create a single field in which you can reference Users, Blocks, Nodes, Contact Forms, Taxonomy Terms, etc!
Use case:
Creating a “related” field, and allowing your administrators to select anything they want.
Entity Reference Drag & Drop
This module creates a Drag & Drop widget for the standard Entity reference fields. It provides you with a list of available entities on the left, and you can select them by dragging and dropping them to the list on the right.
Use case:
Providing a better admin experience.
Phew! Thanks for making it to the end! Do you have a favorite Entity Reference module that we missed? Let us know on Twitter at @xenophiles and @thejimbirch
Happy Drupal maintenance support plansing!
Acknowledgements
Thanks to Mike Acklin for his help with this article, and to all the awesome module maintainers and contributors!
Photo by Bethany Legg on Unsplash
Source: New feed
Entity Reference Roundup
Call Us: 1(800)730-2416
Pixeldust is a 20-year-old web development agency specializing in Drupal and WordPress and working with clients all over the country. With our best in class capabilities, we work with small businesses and fortune 500 companies alike. Give us a call at 1(800)730-2416 and let’s talk about your project.
FREE Drupal SEO Audit
Test your site below to see which issues need to be fixed. We will fix them and optimize your Drupal site 100% for Google and Bing. (Allow 30-60 seconds to gather data.)
Entity Reference Roundup
On-Site Drupal SEO Master Setup
We make sure your site is 100% optimized (and stays that way) for the best SEO results.
With Pixeldust On-site (or On-page) SEO we make changes to your site’s structure and performance to make it easier for search engines to see and understand your site’s content. Search engines use algorithms to rank sites by degrees of relevance. Our on-site optimization ensures your site is configured to provide information in a way that meets Google and Bing standards for optimal indexing.
This service includes:
- Pathauto install and configuration for SEO-friendly URLs.
- Meta Tags install and configuration with dynamic tokens for meta titles and descriptions for all content types.
- Install and fix all issues on the SEO checklist module.
- Install and configure XML sitemap module and submit sitemaps.
- Install and configure Google Analytics Module.
- Install and configure Yoast.
- Install and configure the Advanced Aggregation module to improve performance by minifying and merging CSS and JS.
- Install and configure Schema.org Metatag.
- Configure robots.txt.
- Google Search Console setup snd configuration.
- Find & Fix H1 tags.
- Find and fix duplicate/missing meta descriptions.
- Find and fix duplicate title tags.
- Improve title, meta tags, and site descriptions.
- Optimize images for better search engine optimization. Automate where possible.
- Find and fix the missing alt and title tag for all images. Automate where possible.
- The project takes 1 week to complete.