By Drupal Centric on
If I wanted to change the 'Create new account' title to eg 'Join' in the User module can I simply do a find and replace or is this title recognised in some way and changing it would corrupt the module?
Thanks
If I wanted to change the 'Create new account' title to eg 'Join' in the User module can I simply do a find and replace or is this title recognised in some way and changing it would corrupt the module?
Thanks
Comments
custom log in form
You may want to read this:
http://drupal.org/node/92657
There is a way of changing the form and titles described in the comments
Personal Website
Company Website
Useful
Although quite useful that doesn't seem to explain whether I can just go in to the module and replace the title 'Create new account' with something else without affecting the module. Not knowing a lot of php I'm worried the module will stop working.
user.module
There isn't such an option which would allow you to change this text from the drupal administration panel. It is hardcoded in modules/user/user.module (line 507). Theoretically you can just modify this text there but it is not reccomended for several reasons: http://drupal.org/node/144376
Personal Website
Company Website
Another solution
Create a new block and insert the following code into the body field:
You can modify what you need and then just enable the new log-in block and disable the original one.
Please TEST this code before using on your website.
Personal Website
Company Website
Creating new Login Block (or changing existing one)
I attemped to implement Marcin's suggestion because I want to change the look of the Login block and everyone is saying not to change the CORE files. When I enter the code, the block shows up and has all the right fields, but does not work when I try to use it to actually login. How do I get it to work? (I still have the original login block enabled)
My main purpose of this is to center align the block title and to make the "Create New Account" portion more prominent. I am using Aberdeen so not sure if I should be doing something with the theme instead, but I don't see anything to change there.
I would also like to make a "Create New Account" button to use on some other splash pages that will be accessed from the front page. Would I use a new block to make this?
Localization module
Please use localization module to change the string.
Localization is normally used between languages, but works within language to replace strings as well.
Harjoituspäiväkirja - www.lenkkivihko.fi
Customizing Login Block
Lenkkivihko, that may help the original poster, but it does not help me since I want to customize more than just the text. I actually wanted to remove the "register now" portion of the login block and make it a separate button. I figured out I just need to change the links and now it works correctly.
Another possibility is the string overrides module
I needed to change "Create new account" to "Sign up as a new member" and came across this node.
After fiddling with several different ideas, the easiest by far was the string overrides module. For users who don't need to do anything more complex than this, it's a good solution.
Unforseen changes when modifying "Create new account"
While I don't yet have a solution for this, I can offer a cautionary tale.
I gave this task to an intern of mine, to change via a hook_form_alter in one of our modules. I didn't get a chance to look at his fix, but one of our QA people approved his solution. A month later, after launching, we got a bug report claiming that the admin could no longer create new users via admin > people > add user.
After lots of debugging, it seemed that not even the #validate, yet alone #submit hooks were firing when the page was submitted.
After scouring all changes we had made, I caught a glimpse of this:
Upon dumping the $form variable, I noticed this is the only spot in the form where this text appears. Regardless, it broke core admin functionality.
I know this doesn't answer the question, but it may help some other whom get themselves into a bind while attempting to solve this problem.
[edit] This appears to be a known issues, as found here: https://drupal.org/node/208790
This issue/comment has a nice workaround, if you'd rather not hack core, or install translation modules: https://drupal.org/node/522036#comment-7384794