I'm trying to set up a guide for creating new users on my site. I want to have the new users write there email-address and then receive an email with further instructions. For this I'm using the email_registration module and it works fine.
My problem is that when the new user receives the mail with instructions about creating a new profile, he/she gets sent to a page, which says "Reset password". Although I realize that this is the same situation, as picking a new password, I would like to guide my users through the registration process, starting with a page containing the title "Welcome new user" - or something.
So to make a long story short: Can I change the title and text of the "Reset password" page, when the system realizes that the account in question, have never been used? - and how do i do it?
Comments
If the URL of the reset page
If the URL of the reset page is user/reset/........ then I think the trick would be to implement phptemplate_user_pass_reset($form) or mytheme_user_pass_reset($form) in your theme's template.php. If you simply
return drupal_render($form);within your function then you will dupliate what is currently happening ... then you can start to modify things .. use drupal_set_title() to change the page title ... add any additional text you want ...Have a look here http://api.drupal.org/api/file/developer/topics/forms_api.html/5 you want the section Themeing forms, 2nd numbered para.
gpk
----
www.alexoria.co.uk
gpk
----
www.alexoria.co.uk
Great! It works! :-) . I got
Great! It works! :-) . I got it to work by making a module that contains the following code:
It works, but i don't know if its a bad way to implement this. I'm still pretty insecure about the whole platform, so I'm giving you (and everybody else) a chance to intervene :-) . Thanks once again.
for more fine-grained control
You could use hook_form_alter to change the form
..and thats what I did. Tnx!
..and thats what I did. Tnx! :-)
pass reset page
I am looking to do something similar as well, where did you put the php code in your new module? in the Templates.php file? I am looking at doing some heavy modifications of this page and the user account info pages. Specifically I want to put all the Account and Personal information onto one form on the same page with no tabs. Is there a resource or tutorial on how to use the hooks to modify these forms? I am using v6.4
To use hook_form_alter()
To use hook_form_alter() http://api.drupal.org/api/function/hook_form_alter/6 you need to create a new custom module. (template.php is part of a theme.) See http://drupal.org/node/206753 and related pages. In your case you might call the module accinfo.module, in which case you would call the hook accinfo_form_alter(). For more examples of the use of this hook, go to the API site and search for "form_alter".
What you would then need to do is have a look in http://api.drupal.org/api/file/modules/user/user.module/6 and http://api.drupal.org/api/file/modules/user/user.pages.inc/6 for the routines that render the forms present on the tabs you want to eliminate. Add relevant stuff from these in your form_alter hook. In your implementation of the hook, the third argument will be the id of the form you are trying to modify (i.e. the main user account form).
There are a couple of ways of getting rid of the tabs.
1. Themeing: you could test on the value of $_GET['q'] or arg(n), n>=0 [http://api.drupal.org/api/function/arg/6], in the theme's page.tpl.php. When the right conditions are met, don't output $tabs.
2. A better way might be to deny access to the relevant paths using hook_menu() http://api.drupal.org/api/function/hook_menu_alter/6 in your custom module. The example there shows how to do this.
You may also need to look at the forms API reference http://api.drupal.org/api/file/forms_api.html/6. Plus trying to find bits of code in core that do something similar to what you want is often useful.
Good luck!
gpk
----
www.alexoria.co.uk
gpk
----
www.alexoria.co.uk