How to change "user/register" page?

1 reply [Last post]
nilashis
Offline
Last seen: 4 years 44 weeks ago
Joined: 2011-07-09

want to add more fields and elements to the page ".../user/register", how do i do that?

I know I can use hook_form_alter (right?).. but wanted to know the details on how to do that. I tried the code below - did not work - what is wrong?

I created a module to do that, module name: "userreg"

What am I doing wrong here? Any direction is greatly appreciated!

function userreg_menu_alter() {

$items['user/register'] = array(
'title' => 'Customized Registration Screen',
'page callback' => 'drupal_get_form',
'page arguments' => 'my_login_form',
'access callback' => 'user_is_anonymous',

);

}

function my_login_form(){
$login = array(
'#title' => "Checkbox I just added to user/register",
'#type' => 'checkbox',
);

return $login;

}

mataylraj
Offline
Last seen: 6 years 50 weeks ago
Joined: 2011-06-26
Confused

I'm confused. You said "I know I can use hook_form_alter (right?)" but then your function is not named userreg_form_alter(), it's named userreg_menu_alter(). Am I missing something?

Add to playlist

Add to , or

Add to new playlist:

Add to playlist
This is a member-only feature
But, it's easy to become a member

Add to cart:


Loading...
Contact us

Below are the supported keyboard shortcuts for our video player.

space
Start / stop video
shift
Go to next video
shift
Go to previous video
Increase or decrease player speed by 20%
Skip ahead or go back by 15 seconds
1...9
Jump to a percentage (2 is 20%, for example)
f
Toggle full screen
Videos Pricing More Search
BuildAModule Logo Icon BuildAModule Logo Icon
Become a member!
$29
1 month
$156
6 months
10% off
$276
12 months
20% off
All memberships come with the following:
24 / 7 access to the entire 1800+ video library
An innovative video player with a rolling transcript
Extensive Drupal and cross-platform training
A thorough and thoughtful training style
Progress tracking
Take notes on specific video sections
Intuitive multi-user management
How many users?
user
Go solo with a single user, or give multiple team members access through one account and get discounts by bundling multiple users into a single membership.