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

Supporting organizations: 

Project information

Releases