By Fintan Darragh on
Hi guys,
Is there a way to automatically enable blocks and assign them regions, weights and other settings once the module has been activated?
I am a big fan of making blocks available through custom modules rather than the Drupal admin interface, but I can't seem to find out how to set block settings through the module code.
Any ideas?
Cheers,
-Fin
Comments
In the 'list' $op for
In the 'list' $op for hook_block, you can use any of the block settings as keys of the returned array. They correspond to the columns of the blocks table, so 'status', 'weight', and 'region' are the main ones to worry about. The trick, though, is to visit the block admin page after you enable your module. The blocks won't actually be generated until then.
-----
Übercart -- One cart to rule them all.
Brilliant - surprised I
Brilliant - surprised I didn't see that one earlier. Thanks for the help!