Skip to main content
Category:

in this post, I'll show you how to make theme suggestions for pagers in drupal 8.

<?php

/**
 * @param array $suggestions
 * @param array $variables
 * @param $hook
 */
function mymodule_theme_suggestions_pager_alter(array &$suggestions, array $variables, $hook)
{
  $var = \Drupal::routeMatch()->getParameter('entity');
  if (isset($var) && !empty($var->getEntityTypeId()) && $var->getEntityTypeId() == "search_page") {
    $suggestions[] = $hook . '__search__page';
  }
}  

 

 

Riadh Rahmi

Senior Web Developer PHP/Drupal & Laravel

I am a senior web developer, I have experience in planning and developing large scale dynamic web solutions especially in Drupal & Laravel.

Web Posts

Search

Page Facebook