By vasyok on
If I need override views field template with value of another field,
i write in
views-view-field-VIEW-NAME--DISPLAY-NAME--FIELD-NAME.html.twig
this code:
{{ view.field.ANOTHER-FIELD-NAME.original_value }}
It's works, but what if another field have option
Override the output of this field with custom text.
How to get this custom text in
views-view-field-VIEW-NAME--DISPLAY-NAME--FIELD-NAME.html.twig
?
Comments
Ok, Sollution:
For example i rewrite title field with "some text" value.
in /admin/config/development/settings
Twig development mode - should be ON
in views-view-field-VIEW-NAME--DISPLAY-NAME--FIELD-NAME.html.twig
should be string
Then title field will looks like (Oh thanks drupal.org there is impossible upload images in forum popst, so imsge black area with words)
To find rewrited value need to move cursor on this black area, press Ctrl+F and paste Some text
and you can fiend something like:
So value of overrided field is
{{ view.field.title.options.alter.text }}