Results
24.07.2025
maintenance 1.0.0-beta1 ::
maintenance.module
/**
* Implements hook_theme_registry_alter().
*/
function maintenance_theme_registry_alter(&$theme_registry) {
// Abort if the maintenance_page hook is not defined in current theme.
if (!isset($theme_registry['maintenance_page'])) {
return;
}
// Prevent override during system update route (/update.php). 01.09.2025
messages 2.3.1 ::
messages.module
/**
* Implements hook_theme_registry_alter().
*/
function messages_theme_registry_alter(&$theme_registry) {
// Override the default status messages template.
if (isset($theme_registry['status_messages'])) {
$module_path = \Drupal::service('extension.list.module')->getPath('messages');
$theme_registry['status_messages']['path'] = $module_path . '/templates/misc';
}
} 26.07.2025
views_timeline 1.0.x-dev ::
views_timeline.module
/**
* Implements hook_theme_registry_alter() for Views templates.
*/
function views_timeline_theme_registry_alter(array &$theme_registry) {
$module_path = \Drupal::service('extension.list.module')->getPath('views_timeline');
// Add a custom template for a specific view.
$theme_registry['views_view__views_timeline'] = [
'type' => 'module',
// Custom template file. 25.06.2020
a11y_form_helpers 8.x-1.x-dev ::
a11y_form_helpers.module
/**
* Implements hook_theme_registry_alter().
*/
function a11y_form_helpers_theme_registry_alter(&$theme_registry) {
// Replace default theme form-element.html.twig template from core.
if (strpos($theme_registry['form_element']['path'], 'core/') === 0) {
$path = explode('/', $theme_registry['form_element']['path']);
$module_path = \Drupal::service('extension.path.resolver')->getPath('module', 'a11y_form_helpers');
if (file_exists($module_path . '/templates/' . $path[2])) { 11.06.2024
a12s 1.0.0-beta7 ::
modules/patterns/a12s_patterns.module
/**
* Implements hook_theme_registry_alter().
*/
function a12s_patterns_theme_registry_alter(&$theme_registry): void {
$path = \Drupal::service('extension.list.module')->getPath('a12s_patterns');
if ($element = &$theme_registry['patterns_overview_page']) {
$element['theme path'] = $path;
$element['path'] = $path . '/templates';
} 11.06.2024
a12s 1.0.0-beta7 ::
modules/theme_builder/a12s_theme_builder.module
* Add extra variables to "menu" derived themes, to provide some suggestions.
*
* @see hook_theme_registry_alter()
*/
function a12s_theme_builder_theme_registry_alter(array &$themeRegistry): void {
$path = \Drupal::service('extension.list.module')->getPath('a12s_theme_builder');
if ($element = &$themeRegistry['menu']) {
$element['theme path'] = $path;
$element['path'] = $path . '/templates';
} 26.02.2021
acquia_search 3.0.1 ::
acquia_search.module
/**
* Implements hook_theme_registry_alter().
*
* Helps us alter some Search API status pages.
*/
function acquia_search_theme_registry_alter(&$theme_registry) {
$module_handler = \Drupal::moduleHandler();
$module_path = $module_handler->getModule('acquia_search')->getPath();
$theme_registry['search_api_index']['variables']['acquia_search_info_box'] = NULL;
$theme_registry['search_api_index']['path'] = $module_path . '/templates'; 16.10.2020
acquia_search_solr 8.x-1.0-beta9 ::
acquia_search_solr.module
/**
* Implements hook_theme_registry_alter().
*
* Helps us alter some Search API status pages.
*/
function acquia_search_solr_theme_registry_alter(&$theme_registry) {
$module_handler = \Drupal::moduleHandler();
$module_path = $module_handler->getModule('acquia_search_solr')->getPath();
$theme_registry['search_api_index']['variables']['acquia_search_info_box'] = NULL;
$theme_registry['search_api_index']['path'] = $module_path . '/templates'; 14.03.2018
adaptivetheme 8.x-3.x-dev ::
at_core/includes/preprocess.inc
/**
* Preprocess variables for AT Layout Plugin templates.
* This function is added in at_core_theme_registry_alter().
*
* @param $variables
*/
function at_core_preprocess_at_layout(&$variables) {
$attributes = _at_core_layout_plugin_attributes($variables);
if (isset($attributes['role'])) { 14.03.2018
adaptivetheme 8.x-3.x-dev ::
at_core/includes/alters.inc
/**
* Implements hook_theme_registry_alter().
*
* @param $theme_registry
*/
function at_core_theme_registry_alter(&$theme_registry) {
$theme_hooks = LayoutDiscoveryPlugin::getThemeHooks();
// Only add preprocess functions if entity exposes theme function, and this
// layout is provided by at_core.
if (!empty($theme_hooks)) {
foreach ($theme_registry as $theme_hook => $info) { 20.01.2023
admin_local_tasks 1.0.0-rc1 ::
admin_local_tasks.module
/**
* Implements hook_theme_registry_alter().
*
* Template overrides for local tasks.
*/
function admin_local_tasks_theme_registry_alter(&$theme_registry) {
/** @var \Drupal\Core\Extension\ModuleExtensionList $extension */
$extension = \Drupal::service('extension.list.module');
$path = $extension->getPath('admin_local_tasks');
if (isset($theme_registry['menu_local_tasks'])) {
$theme_registry['menu_local_tasks']['path'] = $path . '/templates/navigation'; 29.05.2025
altcolor 1.0.0-beta1 ::
src/Hook/AltColorHooks.php
/**
* Implements hook_theme_registry_alter().
*
* This hook ensures that this module's preprocess function runs after that of
* a theme. Doing this allows this module to override the CSS variables that
* can possibly come from a theme.
*/
#[Hook('theme_registry_alter')] 29.05.2025
altcolor 1.0.0-beta1 ::
altcolor.module
/**
* Implements hook_theme_registry_alter().
*/
#[LegacyHook]
function altcolor_theme_registry_alter(&$theme_registry) {
\Drupal::service(AltColorHooks::class)->themeRegistryAlter($theme_registry);
}
/**
* Implements hook_preprocess().
*/ 26.11.2021
alter_blocks_element_markup 1.0.0 ::
alter_blocks_element_markup.module
/**
* Implements hook_theme_registry_alter().
*/
function alter_blocks_element_markup_theme_registry_alter(array &$theme_registry) {
$path = \Drupal::service('extension.list.module')->getPath('alter_blocks_element_markup');
$theme_registry['block']['path'] = $path . '/templates';
\Drupal::logger('AlterBlocksElementMarkup')->notice(print_r($theme_registry['block'], true));
}
/** 30.09.2020
amp 8.x-3.5 ::
amp.module
/** * Implements hook_theme_registry_alter(). * * We still want the image_theme to process the image, just output it * in a different template, and only when it used in an AMP component. * A theme could do this with just theme_suggestions_alter(), but if a module * provides an alternate template it won't be discovered automatically by the * theme system. Using theme_register_alter() we can force the theme system to
* actually use directly, then it will be available for the suggestion.
*/
function amp_theme_registry_alter(&$theme_registry) {
$theme_registry['amp_image_wrapper'] = $theme_registry['image'];
$theme_registry['amp_image_wrapper']['template'] = 'amp-image-wrapper';
$theme_registry['amp_image_wrapper']['path'] = \Drupal::service('extension.list.module')->getPath('amp') . '/templates';
}
/** 10.03.2021
append_file_info 8.x-1.0-rc3 ::
append_file_info.module
/**
* Implements hook_theme_registry_alter().
*/
function append_file_info_theme_registry_alter(&$theme_registry) {
foreach ($theme_registry['file_link']['preprocess functions'] as $key => $value) {
if ($value == 'template_preprocess_file_link') {
$theme_registry['file_link']['preprocess functions'][$key] = '_append_file_info_preprocess_file_link';
}
}
} 13.10.2020
at_theme 1.4.1 ::
at_core/includes/preprocess.inc
/**
* Preprocess variables for AT Layout Plugin templates.
* This function is added in at_core_theme_registry_alter().
*
* @param $variables
*/
function at_core_preprocess_at_layout(&$variables) {
$attributes = _at_core_layout_plugin_attributes($variables);
if (isset($attributes['role'])) { 13.10.2020
at_theme 1.4.1 ::
at_core/includes/alters.inc
/**
* Implements hook_theme_registry_alter().
*
* @param $theme_registry
*/
function at_core_theme_registry_alter(&$theme_registry) {
$theme_hooks = LayoutDiscoveryPlugin::getThemeHooks();
// Only add preprocess functions if entity exposes theme function, and this
// layout is provided by at_core.
if (!empty($theme_hooks)) {
foreach ($theme_registry as $theme_hook => $info) { 12.10.2020
audiofield 8.x-1.x-dev ::
audiofield.module
/**
* Implements hook_theme_registry_alter().
*/
function audiofield_theme_registry_alter(&$theme_registry) {
/*
* By default, Drupal 8 does not include theme suggestions from inside the
* module in which they were created, so we must add them manually here.
*/
$path = \Drupal::service('extension.list.module')->getPath('audiofield');
$audioplayer_templates = drupal_find_theme_templates($theme_registry, '.html.twig', $path); 26.06.2020
bee 8.x-1.1 ::
bee.module
/**
* Implements hook_theme_registry_alter().
*/
function bee_theme_registry_alter(&$theme_registry) {
$theme_registry['field__node__field_availability_hourly'] = [
'template' => 'field-availability-hourly',
'path' => \Drupal::service('extension.list.module')->getPath('bee') . '/templates',
'render element' => 'element',
'base hook' => 'field',
'type' => 'module', 