Вы здесь

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

Показывать блок для типов документов story и page:

<?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;
  }
}
return
$match;
?>

Не показывать блок для типов документов story и page:

<?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;
  }
}
return
$match;
?>

Комментарии

Изображение пользователя Анонимно

не работает у меня