PHP block visibility
Show block for specific content type
<?php
$nodeType = "news";
// valid node id in view mode
if ( arg(0) == 'node' AND is_numeric(arg(1)) AND arg(2) == FALSE ) {
$node = node_load(arg(1)); // cached
if ( ($node->type == $nodeType) OR ($node->nid == 19) ) {
return true;
}
}
return FALSE;
?>
Block visible for Specific Content
Type AND Specific URL
<?php
$match = FALSE;
$types = array('content-petites_annonces' => 1);
if (arg(0) == 'node' && is_numeric(arg(1))) {
$nid = arg(1);
$node = node_load(array('nid' => $nid));
Verfasst von admin am 24. März 2011 - 3:07
- Neuen Kommentar schreiben
- 76 Aufrufe