function social_landing_page_theme_suggestions_page_alter in Open Social 8.9
Same name and namespace in other branches
- 8.7 modules/social_features/social_landing_page/social_landing_page.module \social_landing_page_theme_suggestions_page_alter()
- 8.8 modules/social_features/social_landing_page/social_landing_page.module \social_landing_page_theme_suggestions_page_alter()
- 10.3.x modules/social_features/social_landing_page/social_landing_page.module \social_landing_page_theme_suggestions_page_alter()
- 10.0.x modules/social_features/social_landing_page/social_landing_page.module \social_landing_page_theme_suggestions_page_alter()
- 10.1.x modules/social_features/social_landing_page/social_landing_page.module \social_landing_page_theme_suggestions_page_alter()
- 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 278 - 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';
}
}
}