kevinfunk / entityqueue_view_mode
Renders the items of an Entityqueue queue with a chosen view mode on the Edit items screen.
Package info
github.com/kevinfunk/entityqueue_view_mode
Type:drupal-module
pkg:composer/kevinfunk/entityqueue_view_mode
Requires
- drupal/entityqueue: ^1.13
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-10-12 20:57:11 UTC
README
Introduction
Lets an Entityqueue queue show its items on the Edit items screen using a view mode of the referenced entity, instead of just a title.
Items look the way you have set them up under the content type's Manage display: an image and a title, a teaser, whatever the chosen view mode contains. This only changes the editing screen, never your front end.
Requirements
- Drupal 11.1 or later, or Drupal 12 (which itself needs PHP 8.5)
- Entityqueue
Installation
Install it like any module, then enable it:
composer require kevinfunk/entityqueue_view_mode
drush en entityqueue_view_mode
Configuration
- Go to Structure > Entityqueues and edit a queue.
- Open the Entity settings tab and find Item display in the editor.
- Tick Use view mode, choose a View mode (Default is pre-selected) and save.
That is all. Untick Use view mode to go back to plain titles.
The queue's Items field must use Entityqueue's Autocomplete (draggable table) widget, which is Entityqueue's default.
Queues that hold several content types
There is always one view mode per queue, however many content types it accepts. That is how view modes work in Drupal: define the mode once, then set how each content type looks in it under that type's Manage display. A content type that has not set up the chosen view mode is shown with its Default display.
Content types without the view mode
If the saved view mode is not enabled for a content type the queue accepts, the form says so under the dropdown and explains that its items use the Default display instead. To change how items look, edit the view mode under that content type's Manage display. The warning reflects the content types the queue has saved.
Which item types work
Any content entity type with view modes: content, users, media, taxonomy terms and so on. A queue of items that cannot be rendered, such as config entities, shows no setting.
How it works
- The chosen view mode is stored on the queue itself as a third-party setting
(
entityqueue_view_mode.view_mode), so it is exported with the queue's configuration. No setting means plain titles. - The module has no widget of its own. It alters Entityqueue's draggable table
(
hook_field_widget_single_element_entityqueue_dragtable_form_alter()), so dragging, removing, adding, the edit link and the publication status work as before. Only the label of each saved item is replaced. - A queue's item type cannot change once it is saved, so a new queue asks to be saved first and offers the view modes when it is edited.
- Items you cannot view are not rendered with the view mode; they keep the plain restricted label.
- A view mode deleted after it was chosen counts as not being used, and the form shows the box unticked.
Uninstalling
Uninstalling the module is safe. Queues are kept and only this module's setting is removed from them.
Configuration management
Export the changes after configuring a queue:
drush cex
The queue's configuration carries the view mode.
Tests
vendor/bin/phpunit -c web/core web/modules/contrib/entityqueue_view_mode/tests
Kernel tests cover the form, the item rendering, queues with several content types, the helper and uninstalling. Functional tests cover choosing view modes through the queue forms. JavaScript tests drive a real browser to check that the dropdown follows the checkbox; they need a WebDriver (the ddev Selenium Chrome add-on provides one).
Compatibility
The tests pass on Drupal 11.4. The module uses only current APIs (attribute-based hooks, no procedural hooks), so there should be nothing to change when moving to Drupal 12.