Created
June 2, 2017 18:14
-
-
Save crittermike/bf25971bd9d087efb9747b140ff5303e to your computer and use it in GitHub Desktop.
(Drupal 7) List blocks being rendered by the Context module into a given region
This file contains hidden or 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
<?php | |
// Grab an instance of the "Block Reaction" plugin. | |
$context_reaction = context_get_plugin('reaction', 'block'); | |
// Run the block_list() function to find the blocks being rendered | |
// into the region you specify. | |
$context_blocks = $context_reaction->block_list('REGIONNAME'); | |
// Now make sure that we reset the static cache for the block list in case | |
// Context isn't done adding blocks to the region for any reason. | |
drupal_static('context_reaction_block_list', NULL, TRUE); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment