Question

I want to disable a region, to not show blocks in this region to an specific page. I want this because, I have several blocks (more than 20) so in this case is necessary enter to each block, and configure in what page or pages must not be showed. Well I can do that, I just want to know if exist some way to make this task in a more practical way, or in a programmatically way.

I am using Drupal 6.

Was it helpful?

Solution

The quickest way is to unset the region you want hidden in your theme's template.php. For example:

function YOUR_THEME_preprocess_page(&$vars) {
  if (drupal_is_front_page())
    unset($vars['left']);
}

OTHER TIPS

The context module is a very handy way to control blocks on a site which uses them extensively. It allows you to define contexts which show and hide blocks. It will stop the blocks from even being loaded so will help performance.

It makes it much easier to define where and when the blocks appear. Rather than defining things per block you define what blocks appear per context.

This video seems to explain things well.

You may want to try the Region Visibility module.

They say:

This module allows privileged users to set role or page specific visibility settings for regions, similar to the block visibility settings in Drupal core.

I didn't try it out myself, but it seems useful.

Licensed under: CC-BY-SA with attribution
Not affiliated with drupal.stackexchange
scroll top