Create new Twig filters for each attribute type

Created on 1 May 2023, over 1 year ago

Problem/Motivation

Drupal core now has Twig filters for set_attributes and add_class. Although the purpose of those filters is different from the one provided by this module, add_attr, it's still likely to cause some confusion.

Proposed resolution

Deprecate the existing add_attr Twig filter and add new ones that are specific to the type of attribute being altered (image_attribute and link_attribute, for instance). We should use the same patterns for naming and execution as the ones provided by Drupal core.

Remaining tasks

  1. Create new Twig filters
  2. Deprecate the old Twig filter
  3. Test
  4. Commit

User interface changes

None.

API changes

Developers will need to use the new Twig filters in the future, though the deprecated filter will work, in order to provide backward compatibility, for an as-yet-to-be-determined amount of time.

Data model changes

None.

✨ Feature request
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States rlhawk Seattle, Washington, United States

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024