Problem/Motivation

Not sure if by design but if you have a slot and pass a view field to it all settings of the field don't show. Example if I wrap the field in a div tag I'd expect that to be passed in but its not.

Steps to reproduce

Proposed resolution

Respect the view field config?

Remaining tasks

User interface changes

API changes

Data model changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

smustgrave created an issue.

smustgrave’s picture

I asked claude this one and this was the response

ViewFieldSource::getPropValue() reads the rendered field via $view->getStyle()->getField($row_index, $field_name). Inside core Views, this returns the result of $field->theme($row), which themes the
field through views_view_field (singular) — the template body is just {{ output }}.

All the Style-settings wrapping (element_type, element_class, element_wrapper_type, element_wrapper_class, element_label_type, label, etc.) is applied by
\Drupal\views\Hook\ViewsThemeHooks::preprocessViewsViewFields() against the plural template, views-view-fields.html.twig. That preprocess only runs when the standard Fields row plugin renders a row
— which the slot path bypasses.