All paragraph types with a field_paragraphs_title should have a select for the Heading Element

Created on 2 March 2023, almost 2 years ago
Updated 8 March 2024, 10 months ago

Problem/Motivation

Example: The Card Paragraph has a "Title" field, which will be printed as div.card__title.h3 (hardcoded in the Twig template).
Sometimes it does make sense to have a real heading element on cards, furthermore you might want to change the heading size.

Field name:
field_paragraphs_title

Affected paragraph types:

  • Card / Tile
  • Symbol

Steps to reproduce

Proposed resolution

Instead of re-doing the crap we need to do for the CKEDITOR styles select.. you know:

h1.h2|H1 = H2 Optik
h2.h3|H2 = H3 Optik
h2.h4|H2 = H4 Optik
h2.h5|H2 = H5 Optik
h3.h2|H3 = H2 Optik
h3.h4|H3 = H4 Optik
h3.h5|H3 = H5 Optik
h1.h2.text-primary|H1 = H2 Optik prim.
h2.h3.text-primary|H2 = H3 Optik prim.
h2.h4.text-primary|H2 = H4 Optik prim.
h2.h5.text-primary|H2 = H5 Optik prim.
h3.h2.text-primary|H3 = H2 Optik prim.
h3.h4.text-primary|H3 = H4 Optik prim.
h3.h5.text-primary|H3 = H5 Optik prim.
h1.text-secondary|H1 sek.
h2.text-secondary|H2 sek.
h2.h3.text-secondary|H2 = H3 Optik sek.
h2.h4.text-secondary|H2 = H4 Optik sek.
h2.h5.text-secondary|H2 = H5 Optik sek.
h3.h2.text-secondary|H3 = H2 Optik sek.
h3.h4.text-secondary|H3 = H4 Optik sek.
h3.h5.text-secondary|H3 = H5 Optik sek.
div.h1|H1 Optik (keine Überschrift)
div.h2|H2 Optik (keine Überschrift)
div.h3|H3 Optik (keine Überschrift)
div.h4|H4 Optik (keine Überschrift)
div.h5|H5 Optik (keine Überschrift)

We probably should seperate this into two fields:
- Heading Element
-- div
-- h2
-- h3
-- h4
-- h5
- Heading Style (classes)
-- h1
-- h2
-- h3
-- h4
-- h5

The color override (eg: h2.h5.text-secondary) shouldn't be required here..

New field name suggestions:

  • field_paragraphs_title_element
  • field_paragraphs_title_classes

Remaining tasks

User interface changes

API changes

Data model changes

Feature request
Status

Active

Version

1.0

Component

Code

Created by

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

Comments & Activities

Production build 0.71.5 2024