Skip to main content
added 16 characters in body
Source Link

You can use hook_page_alterhook_preprocess_html(). For example, toito remove the system navigation block from the "sidebar_first" region, define the following hook in your MODULE.module: ` function MYMODULE_page_alter(&$page) { if ($my_condition) { $region_name = 'sidebar_first'; $block_name = 'system_navigation';

iffunction (issetMODULE_preprocess_html($page[$region_name][$block_name])&$variables) {
  $page[$region_name][$block_name]['#access']if($variables['page']['REGION']['BLOCK'])
    $variables['page']['REGION']['BLOCK']['#access'] = FALSE;
}

} } ` with REGION = sidebar_first and BLOCK = system_navigation.

You can use hook_page_alter(). For example, toi remove the system navigation block from the "sidebar_first" region: ` function MYMODULE_page_alter(&$page) { if ($my_condition) { $region_name = 'sidebar_first'; $block_name = 'system_navigation';

if (isset($page[$region_name][$block_name])) {
  $page[$region_name][$block_name]['#access'] = FALSE;
}

} } `

You can use hook_preprocess_html(). For example, to remove the system navigation block from the "sidebar_first" region, define the following hook in your MODULE.module:

function MODULE_preprocess_html(&$variables) {
  if($variables['page']['REGION']['BLOCK'])
    $variables['page']['REGION']['BLOCK']['#access'] = FALSE;
}

with REGION = sidebar_first and BLOCK = system_navigation.

Post Undeleted by Jean-Luc Barat
Post Deleted by Jean-Luc Barat
Source Link

You can use hook_page_alter(). For example, toi remove the system navigation block from the "sidebar_first" region: ` function MYMODULE_page_alter(&$page) { if ($my_condition) { $region_name = 'sidebar_first'; $block_name = 'system_navigation';

if (isset($page[$region_name][$block_name])) {
  $page[$region_name][$block_name]['#access'] = FALSE;
}

} } `