Skip to content

Instantly share code, notes, and snippets.

@hkirsman
Last active December 24, 2015 21:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hkirsman/6868514 to your computer and use it in GitHub Desktop.
Save hkirsman/6868514 to your computer and use it in GitHub Desktop.
Find the first block in content region that is not messages block and add class first-content-block-in-region to it.
<?php
function THEME_preprocess_page(&$vars) {
foreach ($variables['page']['content']['content']['content'] as $key => &$var) {
if (isset($var['#block']) && $key !== 'delta_blocks_messages') {
$var['#block']->css_class = 'first-content-block-in-region';
break;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment