By jjj0923 on
we think it's somewhat confusing to have the words "add new comment" to a forum thread and want to change this works to "reply" just like it shows when someone repsonds to a thread "reply" where do we change this?
we think it's somewhat confusing to have the words "add new comment" to a forum thread and want to change this works to "reply" just like it shows when someone repsonds to a thread "reply" where do we change this?
Comments
Line 223 of the comment
Line 223 of the comment module:
$links[] = l(t('add new comment'), "comment/reply/$node->nid", array('title' => t('Share your thoughts and opinions related to this posting.')), NULL, 'comment_form');Change to:
$links[] = l(t('I like cakes'), "comment/reply/$node->nid", array('title' => t('Share your thoughts and opinions related to this posting.')), NULL, 'comment_form');Or whatever ;o) Obviously this *will* affect every instance of comments which are on a node, so maybe it's not ideal? But it'll work...
Pobster
erk... no wait.
Try the local module. See the How to on replacing Drupal terminology for a more future resistent method to do this.
-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain
-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide
String Overrides
Locale is kind of a heavy module if you just want to change one string.
String Overrides is a much lighter way of doing the same thing.
++Andy
Uh-oh ...
Hacking the core is the #1 documented way to go to Drupal hell. Much better to use locale.module, and/or tinker with the links at the presentation template level (which can be restricted by node type).
I concur - is there a way in
I concur - is there a way in the locale.module to test and see if the forums module is the module that's being called to present contact and only do the string replacement for the forums.module?
Theme
Well, I don't like to install too many modules. I already have far too many running and I can feel the impact.
You can do this inside the node-forum.tpl.php.
I once replaced all liks with phpBB like buttons in 4.6:
http://drupal.org/node/56127
But I didn't do this again for my 4.7 install. I like the text links now I guess.
You can do something similar to rename all the links without affecting other node types.
Andre
-------------------------------------------------
http://www.opentravelinfo.com
http://www.aguntherphotography.com
thanks - I took a look at
thanks - I took a look at the code, but I don't understand what I need to change.
I'm not sure where to start in here:
Local is part of core.
Local is part of core. Trust us when we say this is the better way. Right now if a Drupal security release came out, you'd have to remember and document and make sure those who came after you remembered and knew how to change the code you are looking for.
Using local module means you don't have to remember. Just do your update like normal. Far far less headache.
-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain
-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide
Oh
Ah. Hm. In that case use the local module then. No objections.
The code above completely replaces ALL forum links with buttons. I simply copied this stuff from the comment and node modules (I think) and modified it to show buttons instead of text. I only had one reply button ;-) For 4.7 this would most likely have to be changed anyways. I don't think that I had to mess with any of the core modules for this. As I said it was in the template.
As for not changing the code, I completely 100% agree with this. It is what kept me from updating to 4.7 until now. However some changes are completely necessary for me to tailor Drupal to my needs. Fortunately a lot of things can be configured in 4.7 via the admin interface making most of these changes unnecessary.
I usually keep a copy of the original drupal install and just run diff commands on the modules before I update. This way its easy to see what I changed (messed with).
-------------------------------------------------
http://www.opentravelinfo.com
http://www.aguntherphotography.com
Don't know if anyone's still trying to solve this but...
Use the directions here: http://drupal.org/node/24593
Try creating your own function
Creating a custom language is a huge hack. Instead, just edit the array of links before it's rendered!
Put this in your
template.php.$typeis an optional variable that will allow you to specify the content type in yournode.tpl.phpfile (ornode-my_content_type.tpl.php) files. Change$type='page'to$type='my custom text'to customize the output.Now you need to call that custom function from your
node.tpl.phpfile. Find this chunk:... and replace it with:
Why did I change
$linksto$node->links? Because $links is already-rendered HTML. To properly change the text of those links, you need access to the original array of links ($node->links).Todd Ross Nienkerk
Editor, That Other Paper | Co-founder, Four Kitchen Studios
Todd Ross Nienkerk
CEO, Owner, and Co-Founder
Four Kitchens: Websites made with love. For good.
Not quite right
Todd, I like this idea.
However, I must be doing something wrong, because even though "Add new comment" is now the correct custom text, the link goes away; it's just text ...
Also, since the entire template.php code is already enclosed in
<?phpand?>in the first code block, they should not be inserted into the template.php file.Works fine for me
Please note that I explain that the last piece of PHP code should be inserted into
node.tpl.php, nottemplate.php, so I'm not sure why you think I'm formatting that file incorrectly. (Trust me -- I know how to work withtemplate.php.)Perhaps it's because adding PHP to these forums requires typing
<?php ... ?>to effect PHP markup. I'm not mistakenly adding those tags -- I have to in these forums to display color-coded PHP.Todd Ross Nienkerk
Editor, That Other Paper | Co-founder, Four Kitchen Studios
Todd Ross Nienkerk
CEO, Owner, and Co-Founder
Four Kitchens: Websites made with love. For good.
Thanks, Todd.
Thanks, Todd.
I did understand that I needed to remove the php statement from the template.php code snippet, but leave it in the node.tpl.php snippet.
I made the suggestion because I didn't know that <code></code> doesn't work for php code, and I was getting errors when I pasted the code exactly as written.
In any case, I inserted these snippets into those two files in a clean version of Garland and I still don't see the link, so perhaps I have a conflict with some other module that alters that code, too.
Thanks, anyway ...
By the way, using localization to change the string is actually quite simple.
http://drupal.org/node/58030
However, changes to "Add new comment" are not appearing, so I suspect there is a conflict somewhere else.
Perfect
Using the locale module to solve this didn't seem like an elegant solution, as it requires more modules. This however, is perfect, thanks a bunch.
Subscribing, greetings,
Subscribing, greetings, Martijn
Comments
Hi pobster,
I need the "Add new commment" link to be displayed at the bottom of the page , i.e after displaying all the comments, Is it possible?
thanks in advance ,
Cheers
I agree
But modifying the core can cause serious problems