Closed olafgrabienski closed 5 years ago
In case it's not possible or too complicated to have different help texts: Do we need the help text at all?
If an option to hide the help text and/or the contents of $add_text could be added to the variables supplied to theme_paragraphs_field_multiple_value_form() it would be easier to override this in a custom theme function, at least. Or add it to the instance config settings maybe?
@laryn What would you prefer: to differentiate or to remove the help text?
Here's the current code with the help text, https://github.com/backdrop-contrib/paragraphs/blob/1.x-1.x/paragraphs.module#L1185:
$output = '<div class="form-item">';
if (count($items)) {
$output .= $field_content;
}
else {
$add_text = 'No @title_multiple added yet. Select a @title type and press the button below to add one.';
if ($add_mode == 'button') {
$add_text = 'No @title_multiple added yet. Select a @title type and press a button below to add one.';
}
$output .= '<label>' . t('!title !required', array('!title' => $element['#title'], '!required' => $required)) . "</label>";
$output .= '<p><em>' . t($add_text, array('@title_multiple' => t($instance['settings']['title_multiple']), '@title' => t($instance['settings']['title']))) . '</em></p>';
}
$output .= $element['#description'] ? '<div class="description">' . $element['#description'] . '</div>' : '';
$output .= '<div class="clearfix">' . backdrop_render($add_more_button_type) . backdrop_render($add_more_button) . '</div>';
$output .= '</div>';
return $output;
}
@olafgrabienski @bradbulger I'm not sure how necessary the instructions are -- it seems pretty clear typically. I'd probably be in favor of just pruning this down to simply:
No Paragraphs added yet.
What are your feelings about that? Brad, I'm open to something like what you suggested if you feel strongly and can make a PR for it.
No Paragraphs added yet.
That would be sufficient, in my opinion!
That would be OK. It applies well enough to cases where there is only one type, and so no "type" at all from the user's pov
Thanks @bradbulger, merged https://github.com/backdrop-contrib/paragraphs/commit/72b6bdc9a9f6313dbb562d57ca524f7412a25c1e .
When I create content with a Paragraphs field, there is a help text like the following at top of the field:
The "Select a Paragraph type" part appears even when there's only one Paragraph bundle (i.e. type) available, so that there is no option to choose a type. In this case a help text without the "type" part would be better, for example: