Hi,

I am aware of the locale module and the String Output module for changing text, and was hoping to use it to change "Add a comment" to "Reply to this post" for forums. Problem is, changing it in my forums also changes it for blogs (which I want to keep). Are forums and blogs using the same comment code, and how can I change this text for forums but not blogs?

Thanks in advance!

-Brian

Comments

mdixoncm’s picture

I think you could do this with a link_alter implementation, something like

function yourmodule_link_alter(&$links, $node) {
  if($node->type=='forum'){
    foreach ($links as $module => $link) {
      if ($links[$module]['title']==t('Add new comment')){
        $links[$module]['title'] = t('Reply to post');
      }
    }
  }
}

The above was just written and is completely untested, but should be enough to give you the general idea :)

Mike,
Computerminds offer Drupal development, consulting and training

bhenkel’s picture

Hi Mike,

I greatly appreciate your advice. I'm not the most competent programmer - where would I place this code? Thanks, again.

-Brian

lenkkivihko’s picture

The most simple approach is to add yourmodule.module into ./sites/all folder.
add that text into the file.
Enable module and that should do the work.

In case you use drupal 6 you need to create additionally yourmodule.info file

Harjoituspäiväkirja - www.lenkkivihko.fi

aangel’s picture

Worked like a charm, thanks.