Show block only on edit of certain node type

Code: 
<?php // Only show if $match is true $match = false; // Which node types $types = array('lijst' ); // Match current node type with array of types if (arg(0) == 'node' && is_numeric(arg(1))) { $nid = arg(1); $node = node_load(array('nid' => $nid)); $type = $node->type; $display = arg(2); if ($display == 'edit') { $match |= in_array($type, $types); } } return $match; ?>

Reacties

I guess the display can be programmed in a nicer way:

  1. test for the third argument – arg(2) – in the first if-statement
  2. make a $displays an array, like $types

Reactie toevoegen