I need to add a block to an existing Drupal site and would like to if possible automate the process using hook_update_N or something similar.
Specifically I'm referring to the position and region of the block relative to adjacent and following blocks. Is there a Drupal standard method to this process or do I simply need to use SQL to achieve this.
Is there a way to force a block in between others with some trick with the weights, or will I need to actively increment the weight of blocks below this in the same region?
Thanks for any advice!
hook_update_N
andmodule_enable
to enable that module when i runupdate.php
. However there are block settings that I also want to apply such as the theme/region/weight as part of the update process. Forcefully setting the weight of the block however will make it clash with the weight of another block (since I want to insert it between 2 existing blocks).