I've read extensively and think I'm close, but I could use some help. My objective is simply to change the X comments text to "X Incident Updates". I'd be stoked if I could get the count of comments, but I'd settle for setting the link text to "Incident Updates". If there's a URL I've missed somewhere, I'd be happy for the reference.

I'm using a copy of Bluemarine to test with. I'm using this function in my template.php file and can successfully set the title. However, I'm unable to display it. I've tried adding a return $links to the function, but I get nothing displayed.

From what I've read, it looks like I need to edit the node.tpl.php or come up with a different function. Any help would be appreciated.

function bluemarine_links($links, $attributes = array('class' => 'links')) {
	foreach ($links as $module => $link) {   // iterate over the $links array
	if (strcmp($module, 'comment_comments') == 0) {
		$links[$module]['title'] = 'Incident Updates';
		}	
	}
	// drupal_set_message(print_r($links)); // uncomment to display your $links array 
// return $links;
}

peterm

Comments

Jeff Burnz’s picture

You could try the String Overrides module, it makes changing stuff like this very very easy.

peterm95018’s picture

The fix was to use the whole theme_links() function as a prototype function in my template.php file. I inserted my mods into a local copy of theme_links() and got the link title changed. Now I need to test it further.

Peter

abowers’s picture

With your code, I think you can still use the theme_links function to display your links like below:

function bluemarine_links($links, $attributes = array('class' => 'links')) {
    foreach ($links as $module => $link) {   // iterate over the $links array
    if (strcmp($module, 'comment_comments') == 0) {
        $links[$module]['title'] = 'Incident Updates';
        }   
    }

   return theme_links($links, $attributes);
}

It seemed to work for me.

gforce301’s picture

You can get the number of comments for a node. Read here --> http://api.drupal.org/api/function/comment_num_all/6.