By blavish on
I would like to have a block with stuff in it only display in one content type but am not sure what I should put in the php.
I have searched the forums already and got the following codes from two places
$types = array('forum' => 1);
if (condition) {
return TRUE; // block will be shown
}
return FALSE;
Does anyone know how I can use this code or maybe make a new one to display a block only on certain content types?
Thanks.
Comments
Something like this?
Hi
Hi, thanks for that code but it wont work for some reason on my blog. I changed the MyContentType to story but couldnt get it working.
Use php in blocks admin
In Home › Administer › Site building › Blocks
select: Show if the following PHP code returns TRUE (PHP-mode, experts only).
paste in (edit to requirements)
For me it does not work
I have Drupal 6 and it doesn't work.
I've found another post with more complex code, but working:
http://drupal.org/node/355959