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']);
}
}
精彩评论