0

I want to add a class to a views more link available under pager section using template_preprocess_views_view().

enter image description here

6

You can do it by implementing template_preprocess_views_view() in your theme under THEMENAME.theme file as shown below:

/**
 * Implements template_preprocess_views_view()
 * @param array $vars
 */
function THEMENAME_preprocess_views_view(&$vars){
  if(YOUR CONDITION FOR ADDING A CLASS){
    $vars['more']['#options']['attributes']['class'] = array(
      ENTER YOUR CLASSES AS ARRAY ELEMENTS
    );
  }
}

Reference: http://www.drupalthemez.com/blog/d8-adding-class-more-link-view

Not the answer you're looking for? Browse other questions tagged or ask your own question.