Who's Bert?

Better Entity Reference Table. Also, a golden yellow Muppet character on the long running children's television show Sesame Street.

Why?

The default entity reference widget is lacking: there's no obvious way to remove items once added and it's not easy to change the way entities are listed.

How does it work?

Field widget

This module provides a field widget. For more information about how to change field widgets in content entry forms, check the official documentation.

The field widget has several configuration options to change its behaviour:

List formatter plugin

Changes the way the referenced entities are formatted in the table. Out of the box, these implementations are provided:

  • Entity title
  • Entity title (with edit link)
  • Entity title and bundle.
  • Entity title and bundle (with edit link).
  • Entity title and publishing status.

Custom implementations can be provided through plugins with the EntityReferenceListFormatter annotation.

Add entities selection

Changes the type of widget:

  • Autocomplete: Options are loaded on demand by typing a search term. Works best for very large result sets.
  • Select: Options are loaded all at once and can be chosen through a dropdown.
  • Radios: Options are loaded all at once and can be chosen through radio buttons.

Disable duplicate selection

Makes sure the same entity cannot be referenced more than once in the same widget.

Disable remove

Hides the button to remove individual table items.

Add a wrapper (fieldset)

Changes whether the widget is wrapped in a fieldset.

Reference method

This module provides an entity reference method with some additional features. This method is automatically enabled when changing the form display of a field to the bert widget, but can also be changed manually on the field edit page.

The reference method has several configuration options to change its behaviour:

Label formatter plugin

Changes the way entities are formatted in search results. Out of the box, two implementations are provided: Entity title and Entity title and bundle. Custom implementations can be provided through plugins with the EntityReferenceLabelFormatter annotation.

Number of results

The number of suggestions that will be listed. Use 0 to remove the limit.

Same language only

Only include entities with the same language as the active content language.

Disable selection of parent entity

This option makes sure that the entity the field is attached to cannot be referenced in the widget.

Contributing

  • Tests are encouraged. This project doesn't have any test coverage yet, but contributions are welcome.
  • Keep the documentation up to date. Make sure README.md and other relevant documentation is kept up to date with your changes.
  • One pull request per feature. Try to keep your changes focused on solving a single problem. This will make it easier for us to review the change and easier for you to make sure you have updated the necessary tests and documentation.
Supporting organizations: 
Initial development
Further development

Project information

Releases