Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Views: Mark Current Entity

Security covered Maintenance fixes only 4 sites

Part of the Views ecosystem · 280 projects

This module adds special attributes to view rows and fields when the entity ID in the view's argument matches the current entity, helping to visually mark the active item. It currently works with the Table display style and is being expanded to support more.

Synopsis

Provides a Views argument handler which accepts an entity ID: it assumes this entity ID is the same entity type as the base_table of the current view. If it notices the ID passed in the argument matches the ID of a row in the results, it adds an HTML data-views-mark-current="current-entity--row" attribute to the row; and an HTML data-views-mark-current="current-entity--field" attribute to each field in the row.

Currently, it only adds attributes to views' Table style, but support for more styles are coming.

While this module will work with all views display types, it was built with the Attachment, Block, Embed, and Entity Views Attachment (EVA) display types in mind, i.e.: where the module's views argument handler can get the current entity from the context of the page the view is displayed on.

Requirements

  1. Drupal core's views module.

Roadmap

Currently this module only adds attributes to the supports the Table style; but support for the Grid, HTML List, and Unformatted list styles are planned.

Adding support for the Entity Reference list, OPML and RSS styles will need some discussion before they can be implemented, because those machine-readable formats don't have the data- attributes feature of HTML, and thus would be harder to indicate which is the current row. Please file an issue if you need this module to support one of these styles.

Additional tests are also always welcome: they make accepting patches much easier!

Known problems

We don't know of any problems right now. Let us know about one by filing an issue!

Credits

This module was originally written by M Parker (mparker17) at Consensus Enterprises for Health Canada's Health Products and Food Branch (HPFB).

Current maintainers:

We don't know of any similar projects right now. Let us know about one by filing an issue!

Ask your assistant about Views: Mark Current Entity

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

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
4
Tracked since
Dec 2023
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 1
Maintenance
Slowing

Release Timeline

Releases

Version Type Core PHP Release date
2.0.0-rc1 Pre-release 10–11 Apr 9, 2025
2.0.x-dev Dev 10–11 Oct 15, 2024
1.0.0-rc1 Pre-release 9–11 Mar 26, 2024
1.0.0-alpha2 Pre-release 9–10 Dec 7, 2023