Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Entity Reference Revisions Context

Security covered Under active development 20 sites

Part of the Entity ecosystem · 308 projects

This module adds data attributes to entity reference revisions, providing context like whether an entity is the first or last in a list, its position (odd/even), and its relationship to adjacent entities. These attributes are useful for theming and determining an entity's placement within a page context.

This field formatter adds contextual data attributes to entity reference revisions, useful specifically for determining how an element is positioned within a page and when theming a set of entities in the context of a list.

It offers the following:

data-entity-context-first - The first entity in the field

data-entity-context-last - The last entity in the field

data-entity-context-prev="{entity-bundle}" - The bundle of the previous entity

data-entity-context-next="{entity-bundle}" - The bundle of the next entity

data-entity-context-group="{entity-bundle-group-number}" - An increment of groups (where a group is a set of entities with the same bundle

data-entity-context-odd - An odd delta entity in the field list

data-entity-context-even - An even delta entity in the field list

Drupal 8–11

Ask your assistant about Entity Reference Revisions Context

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
2
Tracked since
Sep 2023
Latest release
9 months ago
Releases (12 mo)
1 ▲ from 0
Maintenance
Active

Releases

Version Type Core PHP Release date
2.1.0 Stable 8–11 Jan 8, 2026
2.0.0 Stable 8–10 Sep 28, 2023