getActiveTheme()->getName(); // Optional: Restrict to a specific theme (e.g., 'my_custom_theme') to avoid affecting admin themes. // if ($active_theme !== 'my_custom_theme') { // return; // } // Set the path for the 'region' theme hook to your module's templates directory. if (isset($theme_registry['region']['path'])) { $module_path = \Drupal::service('extension.list.module')->getPath('mobile_facets'); $theme_registry['region']['path'] = $module_path . '/templates'; } }