During the install of a module, I need to assign a View to a Region, and unassign a Block from that region. It’s something that would take 3 seconds in the UI, but this has to be done programmatically.
The view is called ‘legal-footer’ and it needs to be assigned to the region ‘footer’.
Similarly, I have a block called ‘footer-logos’ that’s currently in the ‘footer’ region but needs to be removed.
I think I want hook_block_info_alter, but I’m not sure if it works on a View, and there’s a note in the API docs that it can’t be used to unassign a block…
I’m new to Drupal, and I can whatever I want in the UI pretty easily, but I’m having a hard time with the API.
to assign block to a region use ‘region’ key in the array returned info that contain the name of the region that this block should be assigned to
E.g
and you can Disable exist block by using such query
replace $block_id with the id of the block that you want to disable
UPDATE:
you can use
hook_block_info_alterto disable exist blockgood luck