Drupal 6: Showing a block conditionally based on the node type of the page
I recently created a block view that I wanted to include only on pages of a certain node type. I decided to create a PHP function that returns true or false based based on the page URL and then call the function via the “Page specific visibility settings”, on the block edit screen.
This function returns true or false based on the what type of node the page URL is. I added this function to my template.php file, but you could add it to a module if desired.
Then I added a PHP snippet in the “Page specific visibility settings” on the block edit screen:
Now the block only shows on pages of “MYNODETYPE”.