Display blocks for domain/IP

Last modified: April 7, 2007 - 12:59

I found this very useful being that I wanted to have as certain domain for administration purposes only and the rest of my sites to only show content. This means getting rid of the Log In block and the Navigation block.

Here is what I used in the 'Set Visibility' section for "LogIn" and "Navigation" when setting up the block visibility; (replace the zeros with your domain or ip address)

<?php
global $base_url;
if (
$base_url == 'http://00.00.00.00'){
  return
TRUE;
} else {
  return
FALSE;
}
?>

I now have one web site or domain that has access to all blocks and menus for administering the Drupal install, content, blocks and settings. And the rest of my web sites or domains just list content like news web sites. Works for all blocks!

 
 

Drupal is a registered trademark of Dries Buytaert.