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
- Place a Conditional wrapper with a heading in Before and the Comments field in Content.
- View a node with no comments as a user without the "Post comments" permission.
- The heading shows above an empty section.
Proposed resolution
Test the rendered output with tags stripped, keeping media and form elements as content.
Issue fork generic_components-3644010
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
Comment #3
mogtofu33 commentedComment #5
mogtofu33 commented