Created
October 16, 2013 03:50
-
-
Save steveoliver/7002424 to your computer and use it in GitHub Desktop.
theme.inc::template_preprocess_html checking visibilitiy of regions using has_render_content().
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add information about the number of sidebars. | |
if (has_render_content($variables['page'], 'sidebar_first') && has_render_content($variables['page'], 'sidebar_second')) { | |
$variables['attributes']['class'][] = 'two-sidebars'; | |
} | |
elseif (has_render_content($variables['page'], 'sidebar_first')) { | |
$variables['attributes']['class'][] = 'one-sidebar'; | |
$variables['attributes']['class'][] = 'sidebar-first'; | |
} | |
elseif (has_render_content($variables['page'], 'sidebar_second')) { | |
$variables['attributes']['class'][] = 'one-sidebar'; | |
$variables['attributes']['class'][] = 'sidebar-second'; | |
} | |
else { | |
$variables['attributes']['class'][] = 'no-sidebars'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment