Problem/Motivation

When a field is empty, its label shouldn't appear.

However, when a node contains a Paragraph field that allows unlimited values but has no values entered, the label appears (with no values below it).

Note: this issue involves regular node display, not Views.

Steps to reproduce

Add a Paragraph field ( Entity reference revisions, Reference type: Paragraph) to a content type
Set the Allowed number of values to Unlimited
Add a new node of this new content type
Enter content in the Title and Body, but not in the paragraph field
Click Save

Result: the label for the paragraph field appears, even though there's no content to go with it.

Proposed resolution

Hide the field label when there's no content in the field, so it works the way other fields do.

I've tested this behavior in a custom theme and Olivero.

Thanks very much for this incredibly useful module!

Issue fork paragraphs-3561795

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

kristi wachter created an issue. See original summary.

miroslavstankov made their first commit to this issue’s fork.

miroslavstankov’s picture

Assigned: Unassigned » miroslavstankov

I can take a look at this

miroslavstankov’s picture

Issue summary: View changes

I'm trying to reproduce this issue, but I'm not seeing the label appear when the field is truly empty.
Here's what I did:

  1. Created a Paragraphs field on a content type (Entity reference revisions, unlimited values).
  2. Created two paragraph types: "Quote" (with one plain text field) and "Cards" (with text and image fields).
  3. Created a new node, filled in Title/Body, but added no paragraphs at all to the field (didn't click "Add Quote" or anything).
  4. Saved the node.
  5. Viewed the node: Nothing from the Paragraphs field appears – no label, no wrapper.

Then I tested the "partially empty" case:

  • Edited the node and added a Quote paragraph, but left its text field blank.
  • Saved and viewed: The "Paragraphs" label appears, along with the empty Quote wrapper.
  • If I fill the text, it shows the content properly.
  • If I remove the Quote entirely (so zero paragraphs again), the label disappears completely.

I had to clear cache (drush cr) after those changes to see the correct output.
This seems to work as expected: label hidden only when zero paragraphs are referenced.

miroslavstankov’s picture

Assigned: miroslavstankov » Unassigned
yashaswi18’s picture

Status: Active » Closed (cannot reproduce)

I also tried to replicate this issue on my local setup using Drupal 11.3.3 by testing different scenarios with Paragraph fields (including cases with no referenced items and partially empty paragraphs), but I was not able to reproduce the reported behavior. The field label does not appear when there are no paragraph items, and appears only when at least one paragraph is present, which seems to be the expected behavior.

Closing this issue as “Cannot reproduce” for now. If the issue still persists, please feel free to reopen it and share the exact steps to replicate, including any specific configurations that might be involved.

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.