Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Enable blocks automatically when a theme/module is installed

I developed a Drupal theme and a few modules. The theme defines special regions where the blocks from my modules can be displayed.

In the present condition, first I have to install/activate the modules, then install/enable the theme and then manually enable/configure the blocks. i.e., I have to specify where each block should be displayed.

Is there a way I can set this task to do automatically. That is when I install both the themes and modules, the blocks should be automatically enabled and set in their correct regions.

like image 437
Sparky Avatar asked Feb 22 '11 10:02

Sparky


1 Answers

The context module will let you keep the position of blocks in code. http://drupal.org/project/context

Features http://drupal.org/project/features will let you save panels to code, but that is more complicated than context if you are not already using panels.

Both are not very easy to learn, but there are not many other options :)

like image 50
naxoc Avatar answered Sep 28 '22 18:09

naxoc