Вы здесь

Показывать/не показывать блок для типов документов и/или URL

Показывать блок для документов story и page по адресам news и node/add/story:

<?php
$match
= FALSE;
$types = array('story' => 1, 'page' => 1);
if (
arg(0) == 'node' && is_numeric(arg(1))) {
 
$nid = arg(1);
 
$node = node_load(array('nid' => $nid));
 
$type = $node->type;
  if (isset(
$types[$type])) {
   
$match = TRUE;
  }
}
if (
substr($_SERVER["REQUEST_URI"], 0, 10) == '/news')
{
$match = TRUE;}
if (
substr($_SERVER["REQUEST_URI"], 0) == "/node/add/story")
{
$match = TRUE;}
return
$match;
?>

Не показывать блок для документов story и page по адресам news и node/add/story:

<?php
$match
= TRUE;
$types = array('story' => 1, 'page' => 1);
if (
arg(0) == 'node' && is_numeric(arg(1))) {
 
$nid = arg(1);
 
$node = node_load(array('nid' => $nid));
 
$type = $node->type;
  if (isset(
$types[$type])) {
   
$match = FALSE;
  }
}
if (
substr($_SERVER["REQUEST_URI"], 0, 10) == '/news')
{
$match = TRUE;}
if (
substr($_SERVER["REQUEST_URI"], 0) == "/node/add/story")
{
$match = TRUE;}
return
$match;
?>