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!

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');
}
  • 2
    Even more succinct: $items['user/register']['page callback'] = 'drupal_goto'; $items['user/register']['page arguments'] = array('customlink'); – Clive Apr 24 '14 at 12:00
  • Yeah - that makes more sense... – Felix Eve Apr 24 '14 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 Jun 11 '14 at 11:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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