By Edward.H on
how to change the comment link text " Login or register to post comment" to be shorter ,eg " comment"? thanks in advance!
how to change the comment link text " Login or register to post comment" to be shorter ,eg " comment"? thanks in advance!
Comments
_
Probably the easiest way is use the http://drupal.org/project/stringoverrides module.
Hi WoridFallz thanks,but I
Hi WoridFallz
thanks,but I tried the Stringoverrides before I posted this topic, it won't work. I think probably because "Login or register to post comment" is not pure string that contains links.
_
It would be really helpful if you would include info about what you've already tried in your posts.
Try this in your template.php file:
thanks WorldFallz,but I got
thanks WorldFallz,but I got below error
Fatal error: Cannot use string offset as an array in /var/www/teshine/includes/theme.inc on line 555
.
Instead of
$links['comment_forbidden'] = 'Comment';
try
$links['comment_forbidden']['title'] = 'Comment';
That's off the top of my head, not sure if I"m remembering right.
Michelle
it works!thanks a lot!
it works!thanks a lot!
stringoverrides will work
Stringoverrides.module works - at least current version 6.x-1.8 does. As stated on the project page:
If you look at comment module you can see the placeholders that are passed to t(). So:
Original:
Replacement:
This makes the site play nicer with cas.module.
How do i do that on at specific node type
The above function works like it should.
But i cant figure out how to make the chance on a specific nodetype.
Do anyone have at suggestion??
I'm trying to figure that out too
For a specific node type, I tried the following in my template.php:
But it doesn't work... :(
_
the links template function doesn't have access to the node or the variables array. You'll probably have to use hook_link_alter in a custom module for that.
Implemented and working - yay!
I added a module with this code:
Many thanks!
_
excellent-- thanks for posting back the working code.
How do you get the
How do you get the destination link working? Its logging back you in to the frontpage.
Hey it Worked for Me!!
Don't know about others but somehow it solved my problem at least.
string overrides works
replace the following:
<a href="@login">Login</a> or <a href="@register">register</a> to post commentsHad a slightly different
Had a slightly different string than j0e for Drupal 7 to remove the string altogether:
$conf['locale_custom_strings_en'][''] = array('<a href="@login">Log in</a> or <a href="@register">register</a> to post comments' => '',);D8
Does anyone know how to change this on Drupal 8? Thanks
=-=
you can try using settings.php in the following sections: