function opigno_module_theme_suggestions_alter in Opigno module 3.x
Same name and namespace in other branches
- 8 opigno_module.module \opigno_module_theme_suggestions_alter()
Implements hook_theme_suggestions_alter().
File
- ./
opigno_module.module, line 200 - Contains opigno_module.module.
Code
function opigno_module_theme_suggestions_alter(array &$suggestions, array $variables, $hook) {
$route_name = \Drupal::routeMatch()
->getRouteName();
if (($route_name == 'opigno_module.manager.get_item_form' || $route_name == 'opigno_module.add_external_package' || $route_name == 'opigno_module.add_external_package_ppt') && $hook == 'page') {
$suggestions[] = 'opigno_module_item_form';
}
if (opigno_module_is_activity_route()) {
if ($hook == 'region' && in_array('region__content', $suggestions)) {
$suggestions[] = 'region__content__opigno_module__activity';
}
if ($hook == 'page') {
$suggestions[] = 'page__opigno_module__activity';
}
}
}