theme_suggestions_test.module
Same filename in other branches
File
-
core/
modules/ system/ tests/ modules/ theme_suggestions_test/ theme_suggestions_test.module
View source
<?php
/**
* @file
* Support module for testing theme suggestions.
*/
declare (strict_types=1);
/**
* Implements hook_theme_suggestions_alter().
*/
function theme_suggestions_test_theme_suggestions_alter(array &$suggestions, array &$variables, $hook) {
\Drupal::messenger()->addStatus(__FUNCTION__ . '() executed.');
if ($hook == 'theme_test_general_suggestions') {
$suggestions[] = $hook . '__module_override';
$variables['module_hook'] = 'theme_suggestions_test_theme_suggestions_alter';
}
}
/**
* Implements hook_theme_suggestions_HOOK_alter().
*/
function theme_suggestions_test_theme_suggestions_theme_test_suggestions_alter(array &$suggestions, array $variables) {
\Drupal::messenger()->addStatus(__FUNCTION__ . '() executed.');
$suggestions[] = 'theme_test_suggestions__module_override';
}
/**
* Implements hook_theme_suggestions_HOOK_alter().
*/
function theme_suggestions_test_theme_suggestions_theme_test_specific_suggestions_alter(array &$suggestions, array $variables) {
$suggestions[] = 'theme_test_specific_suggestions__variant__foo';
}
Functions
Title | Deprecated | Summary |
---|---|---|
theme_suggestions_test_theme_suggestions_alter | Implements hook_theme_suggestions_alter(). | |
theme_suggestions_test_theme_suggestions_theme_test_specific_suggestions_alter | Implements hook_theme_suggestions_HOOK_alter(). | |
theme_suggestions_test_theme_suggestions_theme_test_suggestions_alter | Implements hook_theme_suggestions_HOOK_alter(). |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.