Add ability to dynamically add filters to twig tokens

Created on 24 February 2025, about 1 month ago

Problem/Motivation

Cache tags are case-sensitive and cannot contain spaces.

Because the views arguments can result in different types of data, you may want to ensure the cache tags are normalized to avoid duplicate caches or mismatches for cache invalidation.

This feature request is the ability to:

  1. Convert the values of twig tokens to lowercase.
  2. Convert the values of twig tokens to replace spaces with hyphens.

While this can be done already by changing {{ my_value }} to {{ my_value | lower | replace({' ': '-'}) }}, manually applying this to all cache tags can be cumbersome.

Steps to reproduce

N/A

Proposed resolution

TBD

Remaining tasks

TBD

User interface changes

New checkboxes added to the Cache Tags views configuration to select which twig filters to apply.

API changes

N/A

Data model changes

N/A

Feature request
Status

Active

Version

1.4

Component

User interface

Created by

🇨🇦Canada mdolnik

Live updates comments and jobs are added and updated live.
  • views

    Involves, uses, or integrates with views. In Drupal 8 core, use the “VDC” tag instead.

Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024