SearchThemeHooks.php
Namespace
Drupal\search\HookFile
-
core/
modules/ search/ src/ Hook/ SearchThemeHooks.php
View source
<?php
namespace Drupal\search\Hook;
use Drupal\Core\Hook\Attribute\Hook;
/**
* Hook implementations for search.
*/
class SearchThemeHooks {
/**
* Implements hook_theme_suggestions_HOOK().
*/
public function themeSuggestionsSearchResult(array $variables) : array {
return [
'search_result__' . $variables['plugin_id'],
];
}
/**
* Implements hook_preprocess_HOOK() for block templates.
*/
public function preprocessBlock(&$variables) : void {
if ($variables['plugin_id'] == 'search_form_block') {
$variables['attributes']['role'] = 'search';
}
}
}
Classes
Title | Deprecated | Summary |
---|---|---|
SearchThemeHooks | Hook implementations for search. |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.