From 85e033072f4767fec5c126b96f207b110483fd2f Mon Sep 17 00:00:00 2001 From: elizoller Date: Wed, 24 Nov 2021 16:53:15 +0000 Subject: [PATCH] only apply sidebar tweaks when there is a sidebar - part of #501 --- web/themes/custom/asulib_barrio/asulib_barrio.theme | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/web/themes/custom/asulib_barrio/asulib_barrio.theme b/web/themes/custom/asulib_barrio/asulib_barrio.theme index 5cfef75ad..1a3357969 100644 --- a/web/themes/custom/asulib_barrio/asulib_barrio.theme +++ b/web/themes/custom/asulib_barrio/asulib_barrio.theme @@ -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'); + } } /**