Problem/Motivation

The empty message is "No Paragraph added yet."

This forces the term "Paragraphs" to visibility although the concept can be hidden with custom naming (host ERR field, paragraph type naming) completely otherwise.

Proposed resolution

Consider use of the host field name or the allowed paragraph type (if single).

And also allow the creation of a default paragraph that will appear instead of the default message:
#2770507: Allow to select a default paragraph type that will be shown for an empty field

Remaining tasks

User interface changes

Comments

miro_dietiker created an issue. See original summary.

ginovski’s picture

Assigned: Unassigned » ginovski
Status: Active » Needs review
StatusFileSize
new1.36 KB

1. Changed message, using host field name instead or single paragraph type
2. Fixed test.

ginovski’s picture

StatusFileSize
new1.36 KB

Rerolled

toncic’s picture

Status: Needs review » Reviewed & tested by the community

Very nice patch.

drobnjak’s picture

amenity’s picture

This patch very much improves the content editor UX, thanks!

I had to manually apply the second hunk since it targets line 573 of ParagraphsAdministrationTest.php. In Paragraphs 8.x-1.0, that code has moved to line 572.

miro_dietiker’s picture

Thank you for the proposal and the review.

The question to me is - why do we need an empty message at all?
If you look at other Drupal fields, they don't have an empty text. They though typically have a default item added with the "Add more" button.

But i'm really not sure what will provide the best UX.

el1_1el’s picture

Not sure why this useful patch hasnt been committed, but I'm rerolling for 8.x.1.1 and for 8.x.1.x-dev. I also added the functionality to the experimental widget on both 1.1 and dev.

The last submitted patch, 8: consider_field-2823909-8-8.x-1.x-dev.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

berdir’s picture

Status: Reviewed & tested by the community » Needs work

Patch failed tests, that will need to be fixed.

el1_1el’s picture

Yeah, given the volume of undefined vars for bundle in the unit tests, and the fact that when you select multiple paragraphs its ambiguous, Im gonna go with the suggestion in #7 and remove the empty text altogether.

Well, that was worse ¯\_(ツ)_/¯

el1_1el’s picture

StatusFileSize
new1.41 KB

one more try. var title was switched to field_title in dev. removing bundle check and just using the field label for the empty var.

el1_1el’s picture

StatusFileSize
new1.4 KB

my mistake, title in one widget, field_title in the other

miro_dietiker’s picture

Dunno how much repetition for field name should be in the message now that inline form error is stable.
How is core handling this?

berdir’s picture

IEF is still an optional module and core isn't changing it's validation messages because it. But that's not relevant anyway because this is not a validation message :)