How to alter "create new account link " in login box of drupal and give them civicrm user registration link.

Step1:call the form alter hook to do so

function custom_form_alter(&$form, &$form_state, $form_id){
   if($form_id == 'user_login_block' ){//check login box form id
        $items = array();
        if (variable_get('user_register', 1)) {
            $items[] = l(t('Create new account'), "civicrm/profile/create", array('attributes' => array('title' => t('Create a new user account.'),'class'=>'register'),'query'=> array( 'gid' => 10, 'reset' => 1)));
        }
        $items[] = l(t('Request new password'), 'user/password', array('attributes' => array('title' => t('Request new password via e-mail.'))));
        $form['links']['#value'] = theme('item_list', $items);
   }
}
  
Comments