Default Tile title tag to 'p' when description is empty

Created on 3 May 2024, 7 months ago

Problem

For accessibility reasons, if a component only contains a title and no description, then there is no need for a heading tag, as there is no content to structure.

Proposed resolution

Detect the presence of a description before setting title_tag, for example:

{% set title_tag = description ? title_tag|default('h4') : 'p' %}

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇫🇷France spryah

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

    It affects the ability of people with disabilities or special needs (such as blindness or color-blindness) to use Drupal.

Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024