I am trying to override the default user registration form (user_register_form
). I would like for the form to create a CCK node (membership_request
) that is already on the system. I am able to get all of the hook overrides setup correctly but I can not get the fields of the CCK form to show up.
Here is what I have done so far:
sites/all/themes/bootstrap/includes/registry.inc
$hooks['membership_request_node_form'] = array(
'render element' => 'form',
'path' => drupal_get_path('theme', 'bootstrap') . '/templates/forms',
'template' => 'node--membership-request-form',
'arguments' => array('form' => NULL),
'preprocess functions' => array(
'bootstrap_preprocess_membership_request_node_form'
)
);
sites/all/themes/bootstrap/template.php
function bootstrap_preprocess_membership_request_node_form(&$vars) {
//$args = func_get_args();
//array_shift($args);
//$form_state['build_info']['args'] = $args;
//$vars['form'] = drupal_build_form('membership_request_node_form', $form_state['build_info']['args']);
//$vars['form'] = drupal_build_form('membership_request_node_form', membership_request_node_form(array()));
$vars['intro_text'] = t('This is my super awesome reg form');
}
sites/all/themes/bootstrap/templates/forms/node--membership-request-form.tpl.php
<?php
print $intro_text;
//print drupal_render_children($form);
?>
In the below examples, "This is my super awesome reg form" will show up as expected in the new registration form. However, 1) all attempts to pass the form from the preprocess function have failed for me (as shown with the commented lines in the template.php file) 2) when the drupal_render_children
line is uncommented in the tpl file I get the following errors:
Thanks