Generated with the help of an LLM.

Problem/Motivation

The conditional_wrapper component should show its Before and After slots, such as a title, only when its Content slot shows something.
It tests {% if content %} on the render array.

UI Patterns already empties a slot with no markup, denied access or only cache metadata.
Content that renders blank still shows the wrapper: whitespace, a theme hook printing nothing, or an empty tag.
A comment field with no comments and no comment form renders only an empty <section>, so its title stays.

Steps to reproduce

  1. Place a Conditional wrapper with a heading in Before and the Comments field in Content.
  2. View a node with no comments as a user without the "Post comments" permission.
  3. The heading shows above an empty section.

Proposed resolution

Test the rendered output with tags stripped, keeping media and form elements as content.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mogtofu33 created an issue. See original summary.

mogtofu33’s picture

Status: Needs work » Needs review

  • mogtofu33 committed 05e578ce on 1.2.x
    fix: #3644010 Conditional wrapper shows its siblings when the content...
mogtofu33’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.