Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create New Templates for Heading Elements in field_group #3861

Closed
trackleft opened this issue Nov 5, 2024 · 1 comment · Fixed by #3867
Closed

Create New Templates for Heading Elements in field_group #3861

trackleft opened this issue Nov 5, 2024 · 1 comment · Fixed by #3867
Assignees
Labels
bug Something isn't working

Comments

@trackleft
Copy link
Member

trackleft commented Nov 5, 2024

Problem/Motivation

Some content editors have been relying on a bug in field-group-html-element.html.twig to add space between elements. Currently, blocks embedded in content are output using the field-group-html-element.html.twig, which applies the spaceless filter to all rendered HTML.

The spaceless filter was applied in this commit: a119b5c#diff-85998c378764d17df837312a6a3594e772f590e5ef1f3311eaf4252c886ff3f7

Describe the bug

The spaceless filter is too aggressive in the field-group-html-element.html.twig template, resulting in unintended removal of spaces that content editors may rely on for layout purposes.

To Reproduce

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Proposed resolution

I propose creating new templates specifically for heading elements that do not utilize the spaceless filter. This will allow content editors to maintain the necessary spacing for headings while still benefiting from the existing functionality for other elements.

Proposed files:
field-group-html-element.h1.twig
field-group-html-element.h2.twig
field-group-html-element.h3.twig
field-group-html-element.h4.twig

Expected behavior

Screenshots

image

Additional context

This issue is most prevalent with inline buttons within embedded content blocks.

@natebyerley
Copy link

Potentially also happening with taxonomy labels

Screenshot 2024-11-06 at 3 23 20 PM

Screenshot 2024-11-06 at 3 29 08 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
No open projects
Status: Done
3 participants