I'm working in Drupal 6.
I have a requirement to add a particular block when the user is on a blog page. Sounds simple enough, but it's been driving me mad.
The block needs to be shown when the user is viewing a blog overview or an individual blog entry.
I initially thought I could filter it by page name so it only appears when page = /blog/. Unfortunately, that only applies to the blog overview page; the individual blog entry pages have their own URLs (default is /node/ but will be changed to whatever the owner wants).
A bit more googling, and I found out about $node->type=='blog' which should pick up the fact that I'm on a blog entry pages, but doesn't seem to work.
In the admin/build/block/configure page I have page visibility set to PHP mode, and PHP code as follows:
<?php
return ($node->type == 'blog');
?>
but that doesn't seem to work, even though if I print_r($node) in the template, it does show type==blog.
I also added strpos($_SERVER['REQUEST_URI','blog') to the above, but of course since the first condition isn't working, adding the second won't help.
It feels like there should be an obvious answer, but I just can't find it. Can anyone help me out. Thanks.