hook_theme_suggestions_HOOK

hook_theme_suggestions_HOOK(array $variables) Provides alternate named suggestions for a specific theme hook. This hook allows modules to provide alternative theme function or template name suggestions. HOOK is the least-specific version of the hook being called. For example, if '#theme' => 'node__article' is called, then hook_theme_suggestions_node() will be invoked, not hook_theme_suggestions_node__article(). The specific hook called (in this case 'node__article') is available in $variable

hook_theme_suggestions_alter

hook_theme_suggestions_alter(array &$suggestions, array $variables, $hook) Alters named suggestions for all theme hooks. This hook is invoked for all theme hooks, if you are targeting a specific theme hook it's best to use hook_theme_suggestions_HOOK_alter(). The call order is as follows: all existing suggestion alter functions are called for module A, then all for module B, etc., followed by all for any base theme(s), and finally for the active theme. The order is determined by system weig

hook_theme_registry_alter

hook_theme_registry_alter(&$theme_registry) Alter the theme registry information returned from hook_theme(). The theme registry stores information about all available theme hooks, including which callback functions those hooks will call when triggered, what template files are exposed by these hooks, and so on. Note that this hook is only executed as the theme cache is re-built. Changes here will not be visible until the next cache clear. The $theme_registry array is keyed by theme hook name

hook_themes_uninstalled

hook_themes_uninstalled(array $themes) Respond to themes being uninstalled. Parameters array $theme_list: Array containing the names of the themes being uninstalled. See also \Drupal\Core\Extension\ThemeHandler::uninstall() Related topics Hooks Define functions that alter the behavior of Drupal core. File core/lib/Drupal/Core/Render/theme.api.php, line 742 Hooks and documentation related to the theme and render system. Code function hook_themes_uninstalled(array $themes) { // Remove som

hook_themes_installed

hook_themes_installed($theme_list) Respond to themes being installed. Parameters array $theme_list: Array containing the names of the themes being installed. See also \Drupal\Core\Extension\ThemeHandler::install() Related topics Hooks Define functions that alter the behavior of Drupal core. File core/lib/Drupal/Core/Render/theme.api.php, line 728 Hooks and documentation related to the theme and render system. Code function hook_themes_installed($theme_list) { foreach ($theme_list as $th

hook_theme

hook_theme($existing, $type, $theme, $path) Register a module or theme's theme implementations. The implementations declared by this hook specify how a particular render array is to be rendered as HTML. Parameters array $existing: An array of existing implementations that may be used for override purposes. This is primarily useful for themes that may wish to examine existing implementations to extract data (such as arguments) so that it may properly register its own, higher priority implementa

hook_template_preprocess_default_variables_alter

hook_template_preprocess_default_variables_alter(&$variables) Alter the default, hook-independent variables for all templates. Allows modules to provide additional default template variables or manipulate existing. This hook is invoked from template_preprocess() after basic default template variables have been set up and before the next template preprocess function is invoked. Note that the default template variables are statically cached within a request. When adding a template variable th

hook_system_themes_page_alter

hook_system_themes_page_alter(&$theme_groups) Alters theme operation links. Parameters $theme_groups: An associative array containing groups of themes. See also system_themes_page() Related topics Hooks Define functions that alter the behavior of Drupal core. File core/modules/system/system.api.php, line 23 Hooks provided by the System module. Code function hook_system_themes_page_alter(&$theme_groups) { foreach ($theme_groups as $state => &$group) { foreach ($theme_g

hook_system_info_alter

hook_system_info_alter(array &$info, \Drupal\Core\Extension\Extension $file, $type) Alter the information parsed from module and theme .info.yml files. This hook is invoked in _system_rebuild_module_data() and in \Drupal\Core\Extension\ThemeHandlerInterface::rebuildThemeData(). A module may implement this hook in order to add to or alter the data generated by reading the .info.yml file with \Drupal\Core\Extension\InfoParser. Using implementations of this hook to make modules required by set

hook_system_breadcrumb_alter

hook_system_breadcrumb_alter(\Drupal\Core\Breadcrumb\Breadcrumb &$breadcrumb, \Drupal\Core\Routing\RouteMatchInterface $route_match, array $context) Perform alterations to the breadcrumb built by the BreadcrumbManager. Parameters \Drupal\Core\Breadcrumb\Breadcrumb $breadcrumb: A breadcrumb object returned by BreadcrumbBuilderInterface::build(). \Drupal\Core\Routing\RouteMatchInterface $route_match: The current route match. array $context: May include the following key: builder: the instan