- 1971 views
Overriding via HOOK
You can use this hook:
function HOOK_preprocess_views_view_field(&$variables) {
$view = $variables['view'];
$field = $variables['field'];
if ($view->storage->id() == 'VIEW_ID' && $view->current_display == 'CURRENT_DISPLAY_ID' && $field->field == 'field_YOUR_FIELD') {
$variables['output'] = "Your NEW Output!";
}
}
Hints:
- You can find your VIEW_ID by opening your view and checking the URL, it should be something like /admin/structure/views/view/VIEW_ID where last string after slash is your VIEW_ID
- You can find your CURRENT_DISPLAY_ID by hovering over the top banner where all your view displays are, check the URL (in chrome bottom left corner), it should be something like /admin/structure/views/view/user/edit/block_1 where block_1 is CURRENT_DISPLAY_ID. I am writing this because when you have only one display in one view it does not change the URL at all.
- You can find your field_YOUR_FIELD id when you again hover over field in the view and in URL last string after slash is again field_id you need.