Results
17.06.2021
component_library 1.0.x-dev ::
component_library.module
/**
* Implements hook_theme_registry_alter().
*/
function component_library_theme_registry_alter(&$theme_registry): void {
// Ensure there is a theme registry entry for each override.
$theme = Drupal::theme()->getActiveTheme();
if ($theme) {
$theme_name = $theme->getName();
$overrides = \Drupal::entityTypeManager()->getStorage('component_override')->loadByProperties(['theme' => $theme_name]);
if ($overrides) { 21.10.2020
component_schema 1.0.x-dev ::
modules/component_schema_ui_patterns/component_schema_ui_patterns.module
/**
* Implements hook_theme_registry_alter().
*
* Add top-level component variables to the pattern theme.
*
* @see \Drupal\component_schema_ui_patterns\Element\ComponentElement::expandVariables()
*/
function component_schema_ui_patterns_theme_registry_alter(&$theme_registry) {
foreach (UiPatterns::getManager()->getPatterns() as $pattern) {
$definition = $pattern->getPluginDefinition();
if (isset($theme_registry['pattern_' . $definition->id()])) {
if ($component = ComponentSchema::getComponentSchema($definition->id())) {
foreach (array_keys($component->getElements()) as $key) {
$theme_registry['pattern_' . $definition->id()]['variables'][$key] = NULL; 28.07.2020
compose 8.x-1.x-dev ::
compose.module
/**
* Implements hook_theme_registry_alter().
*/
function compose_theme_registry_alter(&$registry) {
$registry['node_edit_form']['path'] = drupal_get_path('module', 'compose') . '/templates';
$registry['node_edit_form']['template'] = 'node-edit-compose-form';
}
/**
* Implements hook_form_node_form_alter(). 09.10.2020
composer_deploy 8.x-1.x-dev ::
composer_deploy.module
/**
* Implements hook_theme_registry_alter().
*/
function composer_deploy_theme_registry_alter(&$theme_registry) {
if (isset($theme_registry['update_version'])) {
$theme_registry['update_version']['type'] = 'module';
$theme_registry['update_version']['path'] = \Drupal::service('extension.list.module')->getPath('composer_deploy') . '/templates';
unset($theme_registry['update_version']['theme path']);
}
} 10.02.2019
cool_message 8.x-2.0 ::
cool_message.module
/**
* Implements hook_theme_registry_alter().
*/
function cool_message_theme_registry_alter(&$theme_registry) {
$coolmessage_enable = \Drupal::config('cool_message.cool_message')->get('coolmessage_enable');
if ($coolmessage_enable) {
$theme_registry['status_messages']['function'] = 'cool_message_status_messages';
}
} 08.08.2020
crocheteer 8.x-1.0 ::
crocheteer_example/src/Plugin/crocheteer/Hook/HookThemeRegistryAlterExample.php
*
* @HookThemeRegistryAlter(
* id = "crocheteer_example_theme_registry_alter",
* title = @Translation("Crocheteer Example: Theme Registry Alter"),
* )
*/
final class HookThemeRegistryAlterExample extends HookThemeRegistryAlterPlugin implements ContainerFactoryPluginInterface {
/** 08.08.2020
crocheteer 8.x-1.0 ::
src/Plugin/Hook/Theme/HookThemeRegistryAlterPluginManager.php
HookPluginInterface::class,
HookThemeRegistryAlter::class,
'crocheteer_theme_registry_alter'
);
}
} 08.08.2020
crocheteer 8.x-1.0 ::
src/Annotation/HookThemeRegistryAlter.php
* Annotation class for Hook Theme Registry Alter. * * @see \hook_theme_registry_alter() * @see \Drupal\crocheteer\Plugin\Hook\Theme\HookThemeRegistryAlterPlugin * @see \Drupal\crocheteer\Plugin\Hook\Theme\HookThemeRegistryAlterPluginManager * @see \Drupal\crocheteer\EventSubscriber\HookThemeRegistryAlterEventSubscriber * * @Annotation */
09.10.2020
custom_search 8.x-1.x-dev ::
custom_search.module
/**
* Implements hook_theme_registry_alter().
*
* @see https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Render!theme.api.php/function/hook_theme_registry_alter
*/
function custom_search_theme_registry_alter(&$theme_registry) {
if (isset($theme_registry['item_list__search_results'])) {
$theme_registry['item_list__search_results']['template'] = 'custom-search-results';
$theme_registry['item_list__search_results']['path'] = \Drupal::service('extension.list.module')->getPath('custom_search') . '/templates';
$theme_registry['item_list__search_results']['variables']['filter_position'] = FALSE;
$theme_registry['item_list__search_results']['variables']['filter'] = '';
} 09.10.2020
dashboards 8.x-1.0-beta10 ::
dashboards.module
/**
* Implements hook_theme_registry_alter().
*/
function dashboards_theme_registry_alter(&$info) {
if (
\Drupal::theme()->getActiveTheme()->getName() == 'gin'
|| in_array('gin', array_keys(\Drupal::theme()->getActiveTheme()->getBaseThemeExtensions()))
) {
$info['dashboards_admin_list']['theme path'] = \Drupal::moduleHandler()->getModule("dashboards")->getPath();
$info['dashboards_admin_list']['path'] = \Drupal::moduleHandler()->getModule("dashboards")->getPath() . '/templates/gin'; 08.11.2019
dhtml_menu 8.x-1.x-dev ::
dhtml_menu.module
/**
* Implementation of hook_theme_registry_alter().
* Replaces the theme functions for the menu_item functions, and stores the
* original functions in order to call them when this module is done with preprocessing.
*/
function dhtml_menu_theme_registry_alter(&$theme_registry) {
/*global $theme;
// Back up the existing theme functions.
$themes = variable_get('dhtml_menu_theme', array());
$themes[$theme] = array(
'menu_item' => $theme_registry['menu_item']['function'], 11.06.2025
display_builder 1.0.x-dev ::
modules/display_builder_views/display_builder_views.module
/**
* Implements hook_theme_registry_alter().
*/
function display_builder_views_theme_registry_alter(array &$theme_registry): void {
$isAdmin = Drupal::service('router.admin_context')->isAdminRoute();
if ($isAdmin) {
return;
}
$template_uri = Drupal::service('extension.list.module')->getPath('display_builder_views') . '/templates'; 11.06.2025
display_builder 1.0.x-dev ::
modules/display_builder_page_layout/display_builder_page_layout.module
/**
* Implements hook_theme_registry_alter().
*/
function display_builder_page_layout_theme_registry_alter(array &$theme_registry): void {
$isAdmin = Drupal::service('router.admin_context')->isAdminRoute();
if ($isAdmin) {
return;
}
$template_uri = Drupal::service('extension.list.module')->getPath('display_builder_page_layout') . '/templates'; 11.10.2020
display_field_copy 2.x-dev ::
display_field_copy.module
/**
* Implements hook_theme_registry_alter().
*
* Shift the preprocess to the top to make it easier to move items.
*/
function display_field_copy_theme_registry_alter(&$theme_registry) {
array_unshift($theme_registry['field']['preprocess functions'], 'display_field_copy_field');
foreach ($theme_registry as $hook => $theme) {
if (isset($theme['base hook']) && $theme['base hook'] == 'field') {
array_unshift($theme_registry[$hook]['preprocess functions'], 'display_field_copy_field');
} 11.09.2020
drowl_paragraphs 8.x-3.9 ::
modules/drowl_paragraphs_types/drowl_paragraphs_types.module
//
///**
// * Implements hook_theme_registry_alter()
// *
// */
//function drowl_paragraphs_types_theme_registry_alter(&$theme_registry) {
// $module_path = drupal_get_path('module', 'drowl_paragraphs');
// $template_objects = drupal_find_theme_templates($theme_registry, '.html.twig', $module_path);
// $paragraph_types = drowl_paragraphs_get_paragraph_types();
//
// // 1. Loop through the paragraph types
// // 2. Check if each paragraph exists in the `$template_objects` array 31.08.2020
ds 8.x-3.9 ::
ds.module
/**
* Implements hook_theme_registry_alter().
*/
function ds_theme_registry_alter(&$theme_registry) {
$layouts = Ds::getLayouts();
$layout_theme_hooks = [];
/** @var \Drupal\Core\Layout\LayoutDefinition $info */
foreach ($layouts as $info) {
if (is_a($info->getClass(), DsLayout::class, TRUE)) {
$layout_theme_hooks[$info->getThemeHook()] = 'layout';
* Process layout.
*
* This function is added in ds_theme_registry_alter().
*/
function ds_preprocess_ds_layout(&$variables) {
$layout_settings = $variables['settings'];
$layout_settings += ['wrappers' => []];
// Fetch the entity type. 26.06.2024
dsfr_paragraph 2.1.x-dev ::
dsfr_paragraph.module
/**
* Implements hook_theme_registry_alter().
*/
function dsfr_paragraph_theme_registry_alter( &$theme_registry ) {
$dp_path = \Drupal::service('extension.path.resolver')->getPath('module', 'dsfr_paragraph');
// Override TEMPLATES
// ----------------------------------------------------------------------------------------------- //
# layout_paragraphs 04.04.2019
dynamic_menu 8.x-0.x-dev ::
dynamic_menu.module
/**
* Implements hook_theme_registry_alter().
*/
function dynamic_menu_theme_registry_alter(&$theme_registry) {
// Add $menu_block_configuration as a variable to the 'menu' theme hook. Set
// its default value to be an empty array.
$theme_registry['menu']['variables']['dynamic_menu_configuration'] = [];
}
/** 26.03.2021
easy_social 8.x-3.x-dev ::
easy_social.module
/**
* Implements hook_theme_registry_alter().
*
* Adds our custom preprocess to all widget's theme functions.
*
* @see _easy_social_preprocess_widget()
*/
function easy_social_theme_registry_alter(&$theme_registry) {
foreach ($theme_registry as $key => $value) {
if (strpos($key, 'easy_social_') === 0) {
if (!empty($theme_registry[$key]['preprocess functions'])) {
array_unshift($theme_registry[$key]['preprocess functions'], '_easy_social_preprocess_widget');
}
}
* Custom pre-process function, used to add settings for widgets.
*
* @see easy_social_theme_registry_alter()
*/
function _easy_social_preprocess_widget(&$variables, $hook) {
global $base_url;
$widget = str_replace("easy_social_", "", $hook); 10.01.2021
ebt_core 1.0.0-alpha3 ::
ebt_core.module
/**
* Implements hook_theme_registry_alter().
*/
function ebt_core_theme_registry_alter(&$theme_registry) {
$module_list = \Drupal::service('extension.list.module')->getList();
$ebt_modules = [];
foreach ($module_list as $module_name => $extention) {
if ($module_name == 'ebt_core') {
continue;
} 