Hi all,

I want to theme my user registration page with node profile.I want 2- page user registration form. On very first page user will fill out Basic Info with some other field, which is defined by node profile module. On second page user will submit a another content type which is not a Node profile page. user will render to second page from first page via a continue button. can i do this? I just want your valuable guidance. Please guide me.

Best,
Kamlesh

CommentFileSizeAuthor
second page.JPG59.47 KBkamleshpatidar
first page.JPG43 KBkamleshpatidar
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

JStarcher’s picture

Issue tags: +subform element, +subform

I used subform element module, it seemed to work best. I ran into a few problems while trying to theme the pages though but was able to find solutions to the problems. You can see my post about the theme issue and a solution to it here: http://drupal.org/node/222392

kamleshpatidar’s picture

Hi Jordon,
i am using subform element module, which is required module for nodeprofile module. I go through your issue page, i tried same thing, what you have done before. i am not able to submit data. Please review my code what i have implemented
template.php

function phptemplate_user_register($form) {
  return _phptemplate_callback('user-register', array('form' => $form));
}

user-register.tpl.php

<?php
drupal_set_title('Create Account');
/*** Unset any information we do not want to use ***/
unset($form['account']['name']['#description']);
unset($form['account']['pass']['#description']);
unset($form['account']['mail']['#description']);
/*
unset($form['uprofile']['form']['#form']['field_address']);
unset($form['uprofile']['form']['#form']['group_links']);
unset($form['uprofile']['form']['#form']['field_company_1']);
unset($form['uprofile']['form']['#form']['field_contact_phone']);
unset($form['uprofile']['form']['#form']['field_type_of_company']);
*/
$form['uprofile']['form']['#form']['group_height']['field_feet']['key']['#options'][''] = t('Feet');
$form['uprofile']['form']['#form']['group_height']['field_inches']['key']['#options'][''] = t('Inches');
$form['uprofile']['form']['#form']['field_ethnicity']['key']['#options'][''] = t('Ethnicity');
$form['uprofile']['form']['#form']['field_state_0']['key']['#options'][''] = t('State');
$form['uprofile']['form']['#form']['field_gender']['key']['#options'][''] = t('Gender');

$form['profile_personal']['form']['#form']['title']['#value'] = 'kamlesh patidar';
$form['account']['name']['#title'] = 'Username';
$form['account']['mail']['#title'] = 'E-Mail';
$form['account']['pass']['pass1']['#title'] = 'Password';
$form['account']['pass']['pass2']['#title'] = 'Password Confirm';
$form['profile_personal']['form']['#form']['field_fname']['values']['#title'] = 'First name1111';
$form['profile_personal']['form']['#form']['field_last_name']['values']['#title'] = '';
$form['profile_personal']['form']['#form']['field_city_0']['values']['#title'] = '';
$form['profile_personal']['form']['#form']['field_zip']['0']['value']['#title'] = 'Zip';
$form['profile_personal']['form']['#form']['field_phone_home']['0']['value']['#title'] = '';
$form['profile_personal']['form']['#form']['field_phone_cell']['0']['value']['#title'] = '';
$form['profile_personal']['form']['#form']['field_age']['key']['#title'] = 'Age';
$form['uprofile']['form']['#form']['group_height']['field_feet']['key']['#title'] = '';
$form['uprofile']['form']['#form']['field_birthdate']['0']['value']['mday']['#title'] = '';
$form['uprofile']['form']['#form']['field_birthdate']['0']['value']['mon']['#title'] = '';
$form['uprofile']['form']['#form']['field_birthdate']['0']['value']['year']['#title'] = '';
$form['uprofile']['form']['#form']['field_ethnicity']['key']['#title'] = '';
$form['profile_personal']['form']['#form']['field_state_0']['key']['#title'] = '';
$form['uprofile']['form']['#form']['field_gender']['key']['#title'] = '';
$form['uprofile']['form']['#form']['group_other']['field_languages']['values']['#title'] = '';
$form['uprofile']['form']['#form']['field_referrer']['0']['user_name']['#title'] = '';

$form['account']['name']['#size'] = 30;
$form['account']['mail']['#size'] = 30;
$form['account']['pass']['pass1']['#size'] = 30;
$form['account']['pass']['pass2']['#size'] = 30;
$form['profile_personal']['form']['#form']['field_fname']['0']['value']['#size'] = 30;
$form['profile_personal']['form']['#form']['field_email2']['0']['value']['#size'] = 30;
$form['profile_personal']['form']['#form']['field_lname']['0']['value']['#size'] = 30;
$form['profile_personal']['form']['#form']['field_city_optional']['0']['values']['#size'] = 30;
$form['profile_personal']['form']['#form']['field_zip']['0']['value']['#size'] = 30;
//$form['profile_personal']['form']['#form']['field_age']['key']['#size'] = 30;
?>

<div id="reg-account-basic">
  <div id="reg-account">
    <div class="reg-header">
      <div class="reg-header-l"></div>
      <div class="reg-header-repeat"><span><?php echo t('Pesonal Information'); ?></span></div>
      <div class="reg-header-r"></div>
      <div class="clear-fix"></div>
    </div>
    <div id="reg-account-content">
<?php
echo drupal_render($form['account']['name']);
echo drupal_render($form['account']['mail']);
echo drupal_render($form['profile_personal']['form']['#form']['field_email2']);
echo drupal_render($form['account']['pass']); ?>

  </div>

  
    
<?php
echo drupal_render($form['profile_personal']['form']['#form']['title']);
echo drupal_render($form['profile_personal']['form']['#form']['field_fname']);
echo drupal_render($form['profile_personal']['form']['#form']['field_lname']);
echo drupal_render($form['profile_personal']['form']['#form']['field_age']);
echo drupal_render($form['profile_personal']['form']['#form']['field_country']);
echo drupal_render($form['profile_personal']['form']['#form']['field_city_optional']);
echo drupal_render($form['profile_personal']['form']['#form']['field_address']);
echo drupal_render($form['profile_personal']['form']['#form']['field_zip']);
echo drupal_render($form['profile_personal']['form']['#form']['field_state']);
echo drupal_render($form['profile_personal']['form']['#form']['field_telephone']);
echo drupal_render($form['profile_personal']['form']['#form']['field_income']);
echo drupal_render($form['profile_personal']['form']['#form']['field_agreement']);
?>
</div>

<?php
echo drupal_render($form);
?>

Change in nodeprofile.module

function nodeprofile_get_register_form() {
  $form = array();
  foreach (nodeprofile_get_types('names') as $type => $type_name) {
    if (nodeprofile_get_settings('register', $type)) {
      // If a role has been selected for registration.
      if (module_exists('rolesignup') && isset($_SESSION['role'])) {
        // Find roles relevant to Role Signup that have settings for the current type.
        if ($register_roles = nodeprofile_get_settings('register_roles', $type)) {
          $user_roles = user_roles(TRUE, 'register for role');
          if (!isset($user_roles[$_SESSION['role']]) || !isset($register_roles[$_SESSION['role']])) {
            continue; // Do not show the current type.
          }
        }
      }
      $form[$type] = array(
        '#type' => 'fieldset',
        '#title' => check_plain($type_name),
        '#collapsible' => TRUE,
        '#weight' => nodeprofile_get_settings('weight', $type),
      );
      $node = (object)array('uid' => 0, 'name' => '', 'type' => $type);
      $form[$type]['form'] = array(
        '#type' => 'subform',
        '#id' => $type. '_node_form',
        //data separation should be set to FALSE, so that imagefield works (see #201804)
        //'#data_separation' => FALSE,
        '#arguments' => array($node),
        '#subform_after_build' => array('nodeprofile_integration_adapt_node_form'),
        '#data_separation' => FALSE,
      );
      $form['#submit']['user_register_submit'] = array();
      $form['#submit']['subform_element_submit'] = array();
    
    }
  }
  if (!empty($form)) {
    $form['#attributes']['enctype'] = 'multipart/form-data';
    return $form;
  }
}

What is wrong in this? please check out this
& for Continue button what i will have to do?
Will you please can share code with me?
Best,
Kamlesh