Posted by ebeyrent on May 9, 2011 at 3:34pm
Does anyone have any tips for theming the user registration form? When I do:
<?php
function mytheme_theme(){
return array(
'user_register' => array(
'arguments' => array('form' => NULL),
),
);
}
function mytheme_user_register($form) {
// die, print, whatever
}
?>Nothing happens (even after clearing caches). I have tried preprocess functions. I have tried a custom template. This shouldn't be that difficult, and I'm feeling awfully stupid at the moment...

Comments
Looks like form_alter is the only option...
I don't see right off any custom theme functions for the user registration form/page... it appears that the best you can do is alter the form to inject new fields, etc. and then you could also (if needed) put in other attributes via the FAPI.
Nothing in user_theme from the user.module has anything related to the registration. It could possibly be in system.module or the misc/ folder though. Not sure... I hate working with the registration forms (historically) and have yet to do anything custom with them in D7.
From user.module:
<?phpfunction user_theme() {
return array(
'user_picture' => array(
'variables' => array('account' => NULL),
'template' => 'user-picture',
),
'user_profile' => array(
'render element' => 'elements',
'template' => 'user-profile',
'file' => 'user.pages.inc',
),
'user_profile_category' => array(
'render element' => 'element',
'template' => 'user-profile-category',
'file' => 'user.pages.inc',
),
'user_profile_item' => array(
'render element' => 'element',
'template' => 'user-profile-item',
'file' => 'user.pages.inc',
),
'user_list' => array(
'variables' => array('users' => NULL, 'title' => NULL),
),
'user_admin_permissions' => array(
'render element' => 'form',
'file' => 'user.admin.inc',
),
'user_admin_roles' => array(
'render element' => 'form',
'file' => 'user.admin.inc',
),
'user_permission_description' => array(
'variables' => array('permission_item' => NULL, 'hide' => NULL),
'file' => 'user.admin.inc',
),
'user_signature' => array(
'variables' => array('signature' => NULL),
),
);
}
?>
Jake Strawn (@himerus)
ThemeGeeks | Development Geeks
Omega - 960.gs