How would you add the link to username's blog that appears in the $links on blog pages to $links on other content types? I've been searching on the forum but haven't found any answers. Thanks for your help.

Comments

Jason Dean’s picture

You can use hook_link in your own module - http://api.drupal.org/api/function/hook_link

Make a module and include some code like this:

function module_name_link($type, $object, $teaser = FALSE) {
  $links = array();
 if ($type == 'node' && $object->type == "content_type_name") {
    if (!$teaser) {
        $links['view_my_blog'] = array(
          'title' => t('View my blog'),
          'href' => "blog/$object->uid",
        );
    }
  }
  return $links;
}

Of course, change module_name and content_type_name to your own module name and required content type to display on.