Page.php in Open Social 8.9
File
themes/socialblue/src/Plugin/Preprocess/Page.php
View source
<?php
namespace Drupal\socialblue\Plugin\Preprocess;
use Drupal\socialbase\Plugin\Preprocess\Page as PageBase;
class Page extends PageBase {
public function preprocess(array &$variables, $hook, array $info) {
parent::preprocess($variables, $hook, $info);
if (theme_get_setting('style') === 'sky') {
$route_match = \Drupal::routeMatch();
if ($route_match
->getParameter('user') && $route_match
->getRouteName() !== 'profile.user_page.single' && $route_match
->getRouteName() !== 'entity.user.edit_form') {
$variables['content_attributes']
->addClass('sidebar-left', 'content-merged--sky');
}
if ($route_match
->getParameter('group') && $route_match
->getRouteName() !== 'entity.group.edit_form') {
$variables['content_attributes']
->addClass('sidebar-left', 'content-merged--sky');
}
if ($variables['page']['complementary_top'] && $variables['page']['complementary_bottom']) {
$variables['content_attributes']
->addClass('complementary-both');
}
}
}
}
Classes
Name |
Description |
Page |
Pre-processes variables for the "page" theme hook. |