I've had to hack the module to enable this feature also on nodes.

function follow_block:

      case 'user':
        $type = arg(0);
        switch($type) {
          case 'user':
            $uid = arg(1);
            break;
          case 'node':
            $node = node_load(arg(1));            
            if(in_array($node->type,array("blog","publication")))
              $uid = $node->uid;
            break;
        }
        if (is_numeric($uid) && ($content = _follow_block_content($uid))) {
          return array(
            'subject' => _follow_block_subject($uid),
            'content' => $content,
          );
        }
        break;

A nice option would be to make an admin setting to select on which nodetypes this block should be displayed.

Comments

q0rban’s picture

Status: Active » Closed (won't fix)

This could be accomplished pretty easily with a custom block using Drupals UI and php input format. For the block's content, set:

<?php
  $node = menu_get_object();
  print _follow_block_content($node->uid);
?>

Set this for your block visibility:

<?php
  return (function_exists('_follow_block_content') && ($node = menu_get_object()) && _follow_block_content($node->uid));
?>
fadgadget’s picture

Hello and thanks for this solution. Is there anyway that i could block the visibility on a page '/latest'.

Thanks

fadgadget’s picture

i used something i had hanging about to only show on certain content types and it seemed to work

<?php
$match = FALSE;
$types = array('bet' => 1, 'notitle' => 1, 'forumpost' => 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;

?>

q0rban’s picture

Category: feature » support
Status: Closed (won't fix) » Fixed

Hi there fadgadget! It sounds like what you are looking for is Context module. It will allow you to designate a context in which this block should display, including all pages but /latest, and not on certain node types. If that's not an option for you, you'll have to use the Php evaluator like comment 1 and check the node type, or do this logic in your own theme preprocess function. I would recommend you don't hack the module, in case there are security updates you need to download.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.