Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Entity Attributes

Security covered Under active development 11 sites

Part of the Entity ecosystem · 308 projects

This module provides a user interface for adding and managing HTML attributes like IDs and classes to various Drupal entities, such as nodes, blocks, and taxonomy terms. It allows for consistent attribute management across different content types without needing multiple specialized modules.

Entity Attributes module provides a UI for managing HTML attributes (id, class, data-*, etc.) across various entity types.

Features

Supported Entity Types

  • Nodes
  • Taxonomy Terms
  • Blocks
  • Menus
  • Content Menu Links
  • Static Menu Links
  • Paragraphs
  • ECK entities

Easy to add support for additional entity types.

Supported Attributes

Attributes are edited in YAML format. The module doesn't apply any restrictions on attribute names and values. Any valid attribute name and value entered in the attributes field will be converted to an attributes object and passed to the entity template.

Attribute Sets

Each entity type may support multiple attribute sets used in their templates:

  • attributes: Main container attributes (id, class, data-*)
  • title_attributes: Title-specific attributes
  • content_attributes: Content wrapper attributes
  • Plugin-specific attribute sets

Please check the module's README for more details about module features and usage.

The long story

Do you remember how often you need to highlight one link in a menu or add an anchor to a specific block on the page? Or when you need to add a class to an element on the site to apply some behavior?
Well, if you do, you are not alone.

Sometimes Drupal theming is difficult — you have to create special templates for elements that should stand out. Sometimes you need more semantic markup, sometimes you just need to add an ID to an element. These cases, and many others, are easily covered by HTML attributes. Despite Drupal having great support for attributes at the template level, there is a lack of UI for managing them at the content level and the glue to connect them to templates.
This is what this module is for.

What? Yet another module for managing classes? I already have five such modules installed.

Right, there are over a dozen good modules that solve these problems and do it well. But this raises another problem — you need to install multiple modules to solve similar issues for different entity types.

Similar modules are focused on handling classes or attributes for specific entity types, and sometimes that is absolutely okay. But if you need a consistent experience for managing attributes across most entity types, this module is quite unique.

Here is a list of the most popular attribute management modules that can be fully or partially replaced by Entity Attributes:

OK, makes sense, but is this module better?

I am not saying this module is the best one ever. It is fully built on Drupal Core APIs. It uses the right approaches for its functionality (stores data in the right place, manages operations the right way). It utilizes modern Drupal and PHP features. It is simple, flexible, and extensible. It is written based on many years of expertise in Drupal frontend and backend development. It is designed to solve one specific problem, and it solves it in the easiest and most consistent way. But it may just not suit your use case.

Drupal 11 · not 10

Ask your assistant about Entity Attributes

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

  • field Drupal core
  • system Drupal core

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
4
Tracked since
Jul 2025
Latest release
3 months ago
Releases (12 mo)
1 ▼ from 3
Maintenance
Active

Release Timeline

Releases

Version Type Core PHP Release date
1.2.0 Stable 11 Jul 6, 2026
1.1.0 Stable 11 Sep 1, 2025
1.0.1 Stable 11 Jul 20, 2025
1.0.0 Stable 11 Jul 20, 2025