Skip to content

Instantly share code, notes, and snippets.

@psynaptic
Created February 26, 2012 06:09
Show Gist options
  • Save psynaptic/1914164 to your computer and use it in GitHub Desktop.
Save psynaptic/1914164 to your computer and use it in GitHub Desktop.
<?php
/**
* Override or insert variables into the page templates.
*
* @param $variables
* An array of variables to pass to the theme template.
*/
function clean_liquid_preprocess_page(&$variables) {
if (isset($variables['attributes_array']['class'])) {
$variables['attributes_array']['class'] = $variables['body_classes'] .' '. $variables['attributes_array']['class'];
}
else {
$variables['attributes_array']['class'] = $variables['body_classes'];
}
if (!empty($variables['skip_link']) || !empty($variables['primary_links_themed']) || !empty($variables['secondary_links_themed']) || !empty($variables['breadcrumb'])) {
$variables['navigation'] = TRUE;
$variables['attributes_array']['class'] .= ' with-navigation';
}
else {
$variables['navigation'] = FALSE;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment