Created
March 28, 2017 15:52
-
-
Save NikLP/6670a386d6a1b9600b0fdac95559d1b1 to your computer and use it in GitHub Desktop.
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
/** | |
* Implements hook_theme_suggestions_HOOK_alter(). | |
* Courtesy @nicrodgers | |
*/ | |
function MYTHEME_theme_suggestions_block_alter(array &$suggestions, array $variables) { | |
if (isset($variables['elements']['content']['#block_content'])) { | |
$block_content = $variables['elements']['content']['#block_content']; | |
$suggestions[] = 'block__' . $block_content->bundle(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment