function social_landing_page_preprocess_page in Open Social 8.3
Same name and namespace in other branches
- 8.9 modules/social_features/social_landing_page/social_landing_page.module \social_landing_page_preprocess_page()
- 8 modules/social_features/social_landing_page/social_landing_page.module \social_landing_page_preprocess_page()
- 8.2 modules/social_features/social_landing_page/social_landing_page.module \social_landing_page_preprocess_page()
- 8.4 modules/social_features/social_landing_page/social_landing_page.module \social_landing_page_preprocess_page()
- 8.5 modules/social_features/social_landing_page/social_landing_page.module \social_landing_page_preprocess_page()
- 8.6 modules/social_features/social_landing_page/social_landing_page.module \social_landing_page_preprocess_page()
- 8.7 modules/social_features/social_landing_page/social_landing_page.module \social_landing_page_preprocess_page()
- 8.8 modules/social_features/social_landing_page/social_landing_page.module \social_landing_page_preprocess_page()
- 10.3.x modules/social_features/social_landing_page/social_landing_page.module \social_landing_page_preprocess_page()
- 10.0.x modules/social_features/social_landing_page/social_landing_page.module \social_landing_page_preprocess_page()
- 10.1.x modules/social_features/social_landing_page/social_landing_page.module \social_landing_page_preprocess_page()
- 10.2.x modules/social_features/social_landing_page/social_landing_page.module \social_landing_page_preprocess_page()
Implements hook_preprocess_page().
1 string reference to 'social_landing_page_preprocess_page'
- social_landing_page_theme_registry_alter in modules/
social_features/ social_landing_page/ social_landing_page.module - Implements hook_theme_registry_alter().
File
- modules/
social_features/ social_landing_page/ social_landing_page.module, line 121 - The Social landing page module.
Code
function social_landing_page_preprocess_page(&$variables) {
$nid = \Drupal::routeMatch()
->getRawParameter('node');
// At this point the parameter could also be a simple string of a nid.
// EG: on: /node/%node/enrollments.
if (!is_null($nid) && !is_object($nid)) {
$node = Node::load($nid);
}
// Here we remove class for landing page.
if (isset($variables['node']) && $node
->bundle() === 'landing_page') {
if ($variables['content_attributes'] instanceof Attribute) {
$variables['content_attributes']
->removeClass('layout--with-complementary');
}
else {
$variables['content_attributes'] = new Attribute();
$variables['content_attributes']
->addClass('container');
}
}
}