I need to do theming of user registration form
I m doing in this way
Module file
function mymodule_form_user_register_form_alter(&$form, &$form_state, $form_id) {
$form['#theme'] = 'user_register';
}
Template file
function mytheme_theme($existing, $type, $theme, $path){
return array(
'user_register' => array(
'render element' => 'form',
'template' => 'templates/user-register',
),
);
}
function mytheme_preprocess_user_register(&$variables) {
$variables['rendered'] = drupal_render_children($variables['form']);
}
And then I added user-register.tpl.php with my desired markup, a
<?php echo $rendered; ?>
Which is working fine . Now problem is that i need to rearrnage order of all fileds
Currently i have following
username, email and password, firstname , last name
I need sequence like username , firstname, email, lastname, password
can anybody tell me how to do this
Thanks