Skip to main content
Commonmark migration
Source Link

There's nothing in the core UI, no.

hook_block_list_alter() exists for exactly this sort of scenario, though:

Act on blocks prior to rendering.

 

This hook allows you to add, remove or modify blocks in the block list. The block list contains the block definitions, not the rendered blocks. The blocks are rendered after the modules have had a chance to manipulate the block list.

e.g.

function MYMODULE_block_list_alter(&$blocks) {
  if ($some_condition) {
    // Remove the block from the list.
    unset($blocks[$some_key]);
  }
}

There's nothing in the core UI, no.

hook_block_list_alter() exists for exactly this sort of scenario, though:

Act on blocks prior to rendering.

 

This hook allows you to add, remove or modify blocks in the block list. The block list contains the block definitions, not the rendered blocks. The blocks are rendered after the modules have had a chance to manipulate the block list.

e.g.

function MYMODULE_block_list_alter(&$blocks) {
  if ($some_condition) {
    // Remove the block from the list.
    unset($blocks[$some_key]);
  }
}

There's nothing in the core UI, no.

hook_block_list_alter() exists for exactly this sort of scenario, though:

Act on blocks prior to rendering.

This hook allows you to add, remove or modify blocks in the block list. The block list contains the block definitions, not the rendered blocks. The blocks are rendered after the modules have had a chance to manipulate the block list.

e.g.

function MYMODULE_block_list_alter(&$blocks) {
  if ($some_condition) {
    // Remove the block from the list.
    unset($blocks[$some_key]);
  }
}
Source Link
Clive
  • 167.9k
  • 19
  • 303
  • 337

There's nothing in the core UI, no.

hook_block_list_alter() exists for exactly this sort of scenario, though:

Act on blocks prior to rendering.

This hook allows you to add, remove or modify blocks in the block list. The block list contains the block definitions, not the rendered blocks. The blocks are rendered after the modules have had a chance to manipulate the block list.

e.g.

function MYMODULE_block_list_alter(&$blocks) {
  if ($some_condition) {
    // Remove the block from the list.
    unset($blocks[$some_key]);
  }
}