Support from Acquia helps fund testing for Drupal Acquia logo

Comments

saschaeggi created an issue. See original summary.

waluigi’s picture

I created a patch for this. In entity_reference_layout.module before it gets rendered, I iterate over all layout_items and simply add a label to it.
Is this the right way to go?

saschaeggi’s picture

Issue summary: View changes
saschaeggi’s picture

@waluigi does this add the layout item name or the name of each paragraph?

waluigi’s picture

Despite your examples (and the title...) I misunderstood you, sorry for that.
I created a new patch that adds the label of the paragraph to the bottom right corner.

waluigi’s picture

saschaeggi’s picture

Patch from #6 works like a charm for me.
Thanks @waluigi.

One thing I discussed with justin2pin if we could make this a module setting. And by default it would not be activated (Checkbox: "Show Paragraph Labels").

waluigi’s picture

I implemented the configuration form for the module and added a checkbox there, as you proposed.
By default the settings is disabled.

saschaeggi’s picture

Status: Active » Needs work

I've tested the patch and can confirm that it works flawlessly.
I would move the settings to /admin/config/content/entity_reference_layout

waluigi’s picture

Moved the settings to /admin/config/content/entity_reference_layout. Thanks for the feedback.

waluigi’s picture

saschaeggi’s picture

Status: Needs review » Reviewed & tested by the community

Works like a charm.
@justin2pin can we move on with this and move it into dev?

justin2pin’s picture

Status: Reviewed & tested by the community » Needs work

Can we move this to form display settings instead of creating a separate settings form? Let me know what you think.

saschaeggi’s picture

Sounds like a good idea, @waluigi can you update the patch?

waluigi’s picture

Tell me if I'm wrong but wouldn't you have to enable it for each field on its own then? Also, it's unclear for me why someone would enable this on one ERL field but not on another one.
So, from my point of view it would make more sense to leave this in the module settings.
What do you think?

justin2pin’s picture

Yes, you would have to enable the setting per-field.

I don't have too strong of an opinion on this since I haven't really seen a need for the feature yet personally, but it seems like it belongs in the form display settings because it directly pertains to the way the field is rendered on edit forms. Also I can imagine this being useful one way for more complex content types with more paragraph types available, and another way for simpler ones.

saschaeggi’s picture

when I did wrote my last comment "sounds like a good idea" I wasn't thinking of the case that a sitebuilder would need to set it on each field. As the case of projects with a lot of different erl fields I would prefer it to have it as a global setting.

So @justin2pin can we move the change from #11 into dev?

saschaeggi’s picture

Status: Needs work » Reviewed & tested by the community

  • justin2pin committed 32a44bf on 8.x-1.x authored by waluigi
    Issue #3086548 by waluigi, saschaeggi: Provide label of paragraph
    
justin2pin’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed. Thanks y'all!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.