Skip to content

Commit

Permalink
only apply sidebar tweaks when there is a sidebar - part of #501
Browse files Browse the repository at this point in the history
  • Loading branch information
elizoller committed Nov 24, 2021
1 parent 94e6833 commit 85e0330
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions web/themes/custom/asulib_barrio/asulib_barrio.theme
Original file line number Diff line number Diff line change
Expand Up @@ -281,9 +281,11 @@ function asulib_barrio_preprocess_user(&$variables) {
*/
function asulib_barrio_preprocess_page(&$variables) {
$variables['site_name'] = \Drupal::config('system.site')->get('name');
$variables['content_attributes']['class'][] = 'col-md-8 mt-2';
$variables['sidebar_first_attributes']['class'][] = 'collapse';
$variables['sidebar_first_attributes']->removeClass('col-md-4');
if (isset($variables['page']['sidebar_first']) && count($variables['page']['sidebar_first']) > 0) {
$variables['content_attributes']['class'][] = 'col-md-8 mt-2';
$variables['sidebar_first_attributes']['class'][] = 'collapse';
$variables['sidebar_first_attributes']->removeClass('col-md-4');
}
}

/**
Expand Down

0 comments on commit 85e0330

Please sign in to comment.