Monday, June 1, 2020

how to can i change the view labels

function modulename_views_pre_render(&$view) {
  if ($view->name == 'user_conversations') {
    //field title
    $view->field['url']->options['alter']['text'] = t('Open Conversation');
   
    //translate and change view labels header 
    $view->field['url']->options['label'] = t('Conversation1');
    $view->field['nothing_2']->options['label'] = t('Guest');
    $view->field['field_st_int_iden']->options['label'] = t('Space1');
    $view->field['conversation_book_start_date']->options['label'] = t('From1');
    $view->field['conversation_book_end_date']->options['label'] = t('To1');
    $view->field['conversation_status']->options['label'] = t('Status1');

    if ($view->current_display == 'owner_conversations') {
      $view->set_title(t('Open requests for my spaces'));
    }
  }
  }

No comments:

Post a Comment

If you have any problem please let me know.