1

I tried using form alter for menu of tabs in /user page, that shows

"create new account", "login", request password

is it possible for us to alter the link so that the create new account can go to "customlink" instead of "user/register"

in drupal 7?

thank you!

1 Answer 1

2

Well, you could use hook_menu_alter() to change the call back function of that menu item:

function MY_MODULE_menu_alter(&$items) {
  $items['user/register']['page callback'] = 'my_custom_function';
}

And then you could redirect to a new page in the callback:

function my_custom_function() {
  drupal_goto('customlink');
}
3
  • 2
    Even more succinct: $items['user/register']['page callback'] = 'drupal_goto'; $items['user/register']['page arguments'] = array('customlink');
    – Clive
    Commented Apr 24, 2014 at 12:00
  • Yeah - that makes more sense...
    – Felix Eve
    Commented Apr 24, 2014 at 12:47
  • the 1st one works thank you!!! for the 2nd one, that needs to go into the hook menu then.. both works great though thank you!
    – Boby
    Commented Jun 11, 2014 at 11:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.