Theming the user registration form?

Events happening in the community are now at Drupal community events on www.drupal.org.
ebeyrent's picture

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...

himerus's picture

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:

<?php
function 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),
    ),
  );
}
?>

Omega Framework

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: