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.
By oriol_e9g on
How I can to add a form with more questions with the registration system?
When a user register an account I only have a form with tow fields (the username and the e-mail), I would like to add more questions and fields, like country, interests... in the user registration form.
How I can do it?
Comments
sorry
sorry,
i found it: http://drupal.org/handbook/modules/profile
Adding Fields to Registration Form - Patch
You may find an issue in that your additional fields show above the standard registrations fields. I am trying to add fields, like you are, and found they appeared above, rather than below.
I belive there is a patch for this:
ISSUE DESCRIPTION: http://drupal.org/node/114103
The probelm I'm having is I'm not sure how to apply a patch (newbie, non-programmer). Help?
the above patch is actually
the above patch is actually easy and can be done by hand.
open profile.module
FIND
$w = 0;
and change that 0 to a 1
basically - means remove and + means add
you do nothing with the while statement, it acts like a road marker.
more information on how to patch can be found in the handbook, use search how to patch its the first thread.
Can't find this line of code
Hi I am a newbie to drupal.
I started by working my way through the following video http://www.youtube.com/watch?v=Vd6Qklh13Ss which ref this post in the second exercise.
I am so new to drupal I don't know which version I am using.
However in the profile.module file I can't find $w = 0;
I can find the following code which looks similar to the code in the first post here but changing $weight is having no effect.
function profile_form_profile($edit, $user, $category, $register = FALSE) {
$result = _profile_get_fields($category, $register);
$weight = 1;
$fields = array();
while ($field = db_fetch_object($result)) {
$category = $field->category;
if (!isset($fields[$category])) {
$fields[$category] = array('#type' => 'fieldset', '#title' => check_plain($category), '#weight' => $weight++);
}
Can anyone help bring me up today ? Many thanks in advance
=-=
new or not you should know what version of drupal is in use. go to administer -> status logs check drupal version.
What you are trying to do no longer has to be done because it's been fixed in later versions of drupal.
$w = 0 was changed to $weight = 1
therefore you aren't doing yourself any favors with regards to watching that tutorial nor trying to follow it especially if you don't know what version of drupal you are using as this was a bug in Drupal 5.
To add fields to "Create Account" registration form of Drupal
In order to add fields to "Create Account" registration form, you can do this in following way:
Go to "--/admin/config/people/accounts/fields" then while "Add new field". While adding new field, under label you could see "Display on user registration form". Check this box and the corresponding field will be shown on registration form.
=-=
I don't believe the advice wouldn't work as the feature and paths in Drupal 5 were quite different. Please don't resurrect old posts for EOL versions of Drupal core.