Problem/Motivation
I build a view to render some content (nodes). This view uses the format Component (UI Patterns). I set up some fields in the view and select a component to render these fields. For slots of the component, I use View field and select the appropriate field to place in slots.
I would like to add a label for a field, but this label is not displayed in the prop that is using this view field. I also added some style settings for field, and did not see these styles to be applied. But the rewrite results settings worked for fields.
These are some screenshots about my set up

For header slot, I use the view field Title

For the field Title, I added a label

As a result, I didn't see the label of the title field is displayed in the slot header of the component.
Expected Behaviours
All the field configurations should be preserved when it is placed in component's slots.
| Comment | File | Size | Author |
|---|---|---|---|
| Screenshot from 2024-09-19 23-26-13.png | 79.55 KB | sea2709 | |
| Screenshot from 2024-09-19 23-25-04.png | 57.78 KB | sea2709 | |
| Screenshot from 2024-09-19 23-23-55.png | 97.28 KB | sea2709 |
Comments
Comment #2
pdureau commentedHi
Thanks for your issue
First test: Component in formatters
With:
It looks OK, I see the Label test at every row.
However, this is not exactly what you are testing here, so let's do a second test.
Second test: Component in view row
With:
Before the test, I need to wait for this fix: #3475574: [2.0.0-beta3] Bug in view row style plugin using views field source because
To be continued...
Comment #3
pdureau commentedComment #4
sea2709 commentedThanks for looking into this.
I confirm your first test works on my end too. I did some tricks to overcome to the issue you mentioned 😅 , anyway, I saw a fix for that issue and it worked. I tried again to put a label, but it doesn't show up!
Comment #5
just_like_good_vibesComment #6
just_like_good_vibesComment #7
pdureau commented#3475574: [2.0.0-beta3] Bug in view row style plugin using views field source was merged, so we can test "Component in view row"
Comment #8
pdureau commentedOk, i reproduced the issue, with:
In
Drupal\ui_patterns_views\Plugin\UiPatterns\SourceViewFieldSource::getPropValue(), we take the field value from$view->style_plugin->getField($row_index, $field_name)without taking the full views_view_field renderable (with label & wrappers)Comment #9
pdureau commentedMaybe in beta4, maybe out of scope
Comment #10
pdureau commentedComment #11
just_like_good_vibeswe need to take a decision on that one, we move to 2.1.x ?
Comment #12
just_like_good_vibesComment #13
pdureau commentedOK for 2.1
Comment #14
pdureau commentedComment #15
dalemoore commentedI just ran into this issue as well, and can confirm that using the "rewrite results" method is a decent workaround for now. I just set it up how I wanted in both sections, under Style Settings and under Rewrite Results. I'll be able to disable the rewrites once it's fixed in UI Patterns. 🎉
Comment #16
just_like_good_vibesPierre, let's check that issue please. In my opinion, we will keep providing value-only.
Comment #17
just_like_good_vibes