PHP block visibility settings
Drupal 4.7 comes with a new option to determine block visibility; by PHP code. When the code returns the value TRUE, the block is displayed, when the code returns FALSE, the block remains hidden:
<?php
if (condition) {
return TRUE; // block will be shown
}
return FALSE;
?>This is of course the verbose equivalent of:
<?php
return (condition);
?>You can enable enter such code at the configuration page of each block in administer » blocks (admin/block). Configure the block and copy the code in the box below Page specific visibility settings. Make sure to select the last radio button (Show if the following PHP code returns TRUE).
For Drupal 4.6, you need to include the visibility conditions as part of the PHP code that generates the block.
