By prezaeis on
i have written the following code to display blocks for a specific content type and it works great
but what i want to do is to modify the code so that the block displays on the front page only AND for the mentioned content type but i cant figure out how to do it
<?php
$match = FALSE;
$types = array('story' => 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;
?>
Comments
sorry just a quick edit to
sorry just a quick edit to the post
i want to display the block for storys only PLUS 2 other paths, those two paths are:
frontpage
/audio/by/artist
any ideas?
=-=
I'd probably scrap that code youre using and ...
insure the content type has a unique path using the pathauto.module
then I'd set my block visibility based on that path and the front page
genius many thanks :D
genius
many thanks :D