Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'm currently using the following code to display the user_register form successfully in a block.
However using this method doesn't include the special Content Profile registration fields that show up on the dedicated /user/register page.
$state=array();
$node = array('type' => $nodeType, 'uid' => $GLOBALS['user']->uid, 'name' => $GLOBALS['user']->uid);
$form = drupal_retrieve_form('user_register',$state);
drupal_prepare_form('user_register', $form, $form_state);
print (drupal_render_form('user_register',$form));
I am guessing it has something to do with the order things get processed, i.e. I'm printing the form before the Content Profile module works its magic. Is there another function I can use here in the block, or any other suggestions that come to mind?