You are here

function opigno_module_theme_suggestions_alter in Opigno module 8

Same name and namespace in other branches
  1. 3.x opigno_module.module \opigno_module_theme_suggestions_alter()

Implements hook_theme_suggestions_alter().

File

./opigno_module.module, line 201
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';
    }
  }
}