I’m using this code to show block in specific urls and content types.
<?php $match = TRUE; // block is visible on the content types entered here $types = array('product_display' => 1, 'page' => 1); $url = request_uri(); if ((arg(0) == 'node') && is_numeric(arg(1))) { $node = node_load(arg(1)); $match = isset($types[$node->type]); } if (strpos($url, "somewhere")) { $match = TRUE; } // copy paste these for additional URLs $tids=array_keys(taxonomy_get_children(7)); foreach($tids as $tid) { if (strpos($url, "taxonomy/term/".$tid)) { $match = TRUE; break; } } return $match; ?>
It works but the block shows in some other urls too, any idea why?