You are here

function social_landing_page_theme_suggestions_page_alter in Open Social 10.3.x

Same name and namespace in other branches
  1. 8.9 modules/social_features/social_landing_page/social_landing_page.module \social_landing_page_theme_suggestions_page_alter()
  2. 8.7 modules/social_features/social_landing_page/social_landing_page.module \social_landing_page_theme_suggestions_page_alter()
  3. 8.8 modules/social_features/social_landing_page/social_landing_page.module \social_landing_page_theme_suggestions_page_alter()
  4. 10.0.x modules/social_features/social_landing_page/social_landing_page.module \social_landing_page_theme_suggestions_page_alter()
  5. 10.1.x modules/social_features/social_landing_page/social_landing_page.module \social_landing_page_theme_suggestions_page_alter()
  6. 10.2.x modules/social_features/social_landing_page/social_landing_page.module \social_landing_page_theme_suggestions_page_alter()

Implements hook_theme_suggestions_HOOK_alter().

File

modules/social_features/social_landing_page/social_landing_page.module, line 348
The Social landing page module.

Code

function social_landing_page_theme_suggestions_page_alter(array &$suggestions, array $variables) {

  // Get Request Object.
  $request = \Drupal::request();

  // If there is HTTP Exception..
  if ($exception = $request->attributes
    ->get('exception')) {

    // Get the status code.
    $status_code = $exception
      ->getStatusCode();
    if ($status_code == 404) {
      $suggestions[] = 'page__node__landing_page';
    }
  }
}