开发者

How to replace label on specific page?

I am trying to create a Your Story functionality where the users can submit their stories in form of a comment. I've made a standard page with comments functionality, however instead of 'add new comment' label, I would like to have 'submit your story'. How can I alter this label only on that particular site and keep it as it is on ot开发者_开发问答her pages?


The easy way is to use the String Overrides module.

Based on your comment, a variation on the code below should work in your template.php file (based on some code posted on drupal.org):

function phptemplate_preprocess_node(&$vars) {
  if ($vars['links'] && $vars['node']->type == 'page') {
    $vars['links'] = str_replace('Add new comment', t('Submit your story'), $vars['links']);
  }
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜