Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By maadis.ie on
Hi, I am preprocessing my view field (event calendar view), where I have the followings:
(1) view name= calendar,
(2) Current_display = block_2, and
(3) I have 'event_calendar_date' (event date) field that I would like to preprocess.
I have the following code:
function MyTheme_preprocess_views_view_fields(&$vars) {
$view = $vars['view'];
if($view->name=='calendar' && $view->current_display=='block_2') {
foreach ($vars['fields'] as $id=>$field) {
if($id == 'event_calendar_date'') {
$vars['fields'][$id]->content = 'some text ';
}
}
}
}
Have I missed something here? It is not working.
Thanks,
Maadis.