You are here

function simplelogin_theme_registry_alter in SimpleLogin 8.6

Same name and namespace in other branches
  1. 7 simplelogin.module \simplelogin_theme_registry_alter()

Implements hook_theme_registry_alter

File

./simplelogin.module, line 176
The module file for simplelogin pages module.

Code

function simplelogin_theme_registry_alter(&$theme_registry) {
  $path = drupal_get_path('module', 'simplelogin');

  // Check if file exists in the theme directory.
  $theme = \Drupal::theme()
    ->getActiveTheme();
  if (file_exists($theme
    ->getPath() . '/templates/page--simplelogin.html.twig')) {
    $path = drupal_get_path('theme', $theme
      ->getName());
  }
  $theme_registry['page__simplelogin'] = array(
    'preprocess functions' => array(
      0 => 'simplelogin_preprocess_simplelogin',
    ),
    'template' => 'page--simplelogin',
    'path' => $path . '/templates',
    'render element' => 'page',
    'type' => 'base_theme_engine',
  );
}