4

I've got a register link and a log in link that is augmented by logintoboggan. All I want to do is redirect the register link from the user account form page to a new page I've just made. It seems very simple, but I can't find where the I can change the link. Any help would be amazing, thanks.

2
0

Use a hook_menu_alter to alter the user/register path and add your own page callback to it.

1
  • Thanks, karthik. I really just needed to find where the URL was, which was in the template folder, duh. – egggsaplenty Nov 30 '11 at 22:41
0

Also you can do it in your template.php of active theme or custom module

 function YOURthemename_preprocess_page(&$vars) {
      // this will give you a good idea of the page content and variables
      if(arg(0)=='user' && arg(1)=='register'){
              drupal_goto('newregisterpath');
      }
        if((arg(0)=='user' && arg(1)=='login') || if(arg(0)=='user' && arg(1)=='')){
         drupal_goto('newloginpath');
       }
    }

And further you have modules like Path_redirect etc already mentioned in the previous comments.

Hope it willhelp you!

0

You can also try the Redirect module. Here is a quote about it (from the module's project page):

Work in progress for a Drupal 7 integration and collaboration between redirection-type modules:

Current features:

  • Common API for loading, saving, and deleting redirects.
  • Case-insensitive redirect matching with a hook to allow other modules to narrow-down the candidate redirects.
  • Redirect counter and last used timestamp, with automatic cleanup of inactive redirects.
  • Integration with Drupal's page cache to optimize redirects and performance.
  • Complete individual redirect access API.
  • Views API integration.

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.