function OliveroHooks::preprocessItemListSearchResults

Same name and namespace in other branches
  1. 11.x core/themes/olivero/src/Hook/OliveroHooks.php \Drupal\olivero\Hook\OliveroHooks::preprocessItemListSearchResults()

Implements hook_preprocess_item_list__search_results().

Attributes

#[Hook('preprocess_item_list__search_results')]

File

core/themes/olivero/src/Hook/OliveroHooks.php, line 574

Class

OliveroHooks
Hook implementations for olivero.

Namespace

Drupal\olivero\Hook

Code

public function preprocessItemListSearchResults(&$variables) : void {
  if (isset($variables['empty'])) {
    $variables['empty']['#attributes']['class'][] = 'empty-search-results-text';
    $variables['empty']['#attached']['library'][] = 'olivero/search-results';
  }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.