How to theme the User registartion form with Profile2 types ? Drupal 7 (Changing the order Or #weight of profile2 in user registration form )
You have to write the following code in your template.php file under your theme folder
/** * Implement hook_theme() in your template.php file under your theme folder. */ function YOURTHEMEFOLDERNAME_theme() { $items = array(); $items['user_register_form'] = array( 'render element' => 'form', 'path' => drupal_get_path('theme', 'YOURTHEMEFOLDERNAME') . '/templates', 'template' => 'user-register', 'preprocess functions' => array( 'YOURTHEMEFOLDERNAME_preprocess_user_register' ),);
return $items;
}
/** * Preprocessor function & hook_preprocess(). */ function YOURTHEMEFOLDERNAME_preprocess_user_register(&$vars) { $vars['intro_text'] = t('Get Started with a free account'); }
You have to write the following code in your YOURTHEMEFOLDERNAME/templates/user-register.tpl.php file under your theme templates folder [YOURTHEMEFOLDERNAME/templates/user-register.tpl.php]
<?php
print drupal_render_children($form);
?>
Comments
Post a Comment