When you add a field to a content type, you can add a "Help text" that should appear next to the form field label when adding content.
For Paragraphs fields with a cardinality of one, this help text disappears, a Paragraph is added.
(Help texts do appear for the individual fields within the Paragraph, just not for the parent Paragraph field.)

Comments

codesmith created an issue. See original summary.

VladimirMarko’s picture

Status: Active » Postponed (maintainer needs more info)

I tested this on 8.4.x / 8.x-1.1 and 8.4.x / 8.x-1.x and I could not reproduce it. The help text always appears right above the "Add {paragraphs type}" dropbutton.
I tried both widgets both times ("Classic" and "EXPERIMENTAL").

What Drupal core version are you using?

codesmith’s picture

Status: Postponed (maintainer needs more info) » Active

I'm using 8.3.1. If it helps, I don't have the "Add {paragraphs type}" dropbutton - only one of the Paragraph type is allowed.

Here's a screenshot showing the Help text added for the Paragraph "Buy Links" field

Only local images are allowed.

Here's a screenshot showing the field on the Add Content page. No help text for "Buy Links" field is showing.

Only local images are allowed.

primsi’s picture

Version: 8.x-1.1 » 8.x-1.x-dev

And apart from single paragraph type it has to be a single value field.

miro_dietiker’s picture

Status: Active » Postponed (maintainer needs more info)

I tested with a single paragraph ERR field, allowing a single paragraph type (Image).
Paragraphs automatically adds the paragraph when creating content, but the help text displays.

So i don't get the problem. Is this field type specific?

sheise’s picture

Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new1.33 KB

I am experiencing the same problem.

This occurs when using a Paragraph field (type: Entity reference revisions) limited to 1 value.

Patch attached which fixes the issue but could definitely use some testing.

edit: I'm on core 8.2.2 and paragraphs latest dev.

Status: Needs review » Needs work

The last submitted patch, 6: paragraphs-2873851-6-help-text-limited-value.patch, failed testing.

VladimirMarko’s picture

Assigned: Unassigned » VladimirMarko

I see now.

However, that patch is definitely not the way to go.

I will try to fix it.

sheise’s picture

Wow I just retried my patch and it's totally not doing what it seemed to be doing earlier.
I'm hiding that patch so no one tries to use it mistakenly.

VladimirMarko’s picture

Assigned: VladimirMarko » Unassigned
Issue summary: View changes
StatusFileSize
new2.55 KB

I added the field title and the help text, but I am not entirely happy with them: They are not visually distinguished form the contained paragraph's field titles and help texts. Additionally, the position of the help text seems to be unstable, so we probably need some wrapper HTML element.

There are no tests yet.

I also tired creating a paragraph field with a finite cardinally >1. Those work fine even without the patch, however.

Updated the issue summary.

I don't want to spend any more time on this. Unassigned.

pieterjandp’s picture

The patch in #10 cannot be applied to the latest version of paragraphs.

I used hook_field_widget_form_alter as a workaround to display the description under the paragraph label (only tested for cardinality 1):

/**
 * Implements hook_field_widget_form_alter().
 */
function MY_MODULE_field_widget_form_alter(&$element, &$form_state, $context) {
  if ($element['#paragraph_type'] == 'MY_PARAGRAPH_TYPE') {
    $element['description'] = [
      '#type' => 'container',
      '#weight' => -1,
      '#attributes' => ['class' => ['description']],
      'info' => ['#markup' => $element['#description']],
    ];
  }
}