Optional profil fields displayed on signup page

Optional profil fields displayed on signup page

by marwa bekrar -
Number of replies: 6

Hi moodlers,


How can I make some optional fields optional fields like :  Institution, Mobile phone, Address  display on signup page? 


Also, is there a way to make date of birth appear in the signup page too ? 


Thank you.


I am using moodle 3.1 



Average of ratings: -
In reply to marwa bekrar

Re: Optional profil fields displayed on signup page

by Helen Foster -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hello,

As far as I know, in standard Moodle it is only possible to make custom profile fields display on the signup page. Please see the documentation User profile fields for more details.

In reply to Helen Foster

Re: Optional profil fields displayed on signup page

by marwa bekrar -
Hello,


I already added some custom profile fields, but for day of birth for example, not only it is a repetition on the user profile (there is date of birth by default in the user profil) , the date type on custom fields contains hours and minutes , which is not suitable for my case. 


Thank you, 



In reply to marwa bekrar

Re: Optional profil fields displayed on signup page

by Gonzalo Gutierrez -

Hi marwa, I also need to do this.

It's extrange how the profile fields function.

Custom profile fields

  • can be display in signup form.
  • aren't display in participants list.


Optional profile fields

  • can be display in participants list.
  • cannot be display in signup form


In my case, i need is to display que same fields in participants list and in the signup form... i think that without modifing the code it isn't possible.

Maybe somebody can help us.

Regards,

In reply to Gonzalo Gutierrez

Re: Optional profil fields displayed on signup page

by marwa bekrar -

Hi Gonzalo, 


I think Jon answered your second question smile 


I tested the plugin and it works !  



In reply to marwa bekrar

Re: Optional profil fields displayed on signup page

by Gonzalo Gutierrez -

Excelent!

Another way to achive this is adding some code lines in login/signup.php, calling the optionals profile fields. Arround line 90 i try with this code and functions, but surely the plugin is the better solution.


mform->addElement('text', 'phone1', get_string('phone1'), 'maxlength="255" size="20"');
        $mform->setType('phone1', PARAM_TEXT);
        if (!empty($CFG->defaultcity)) {
            $mform->setDefault('phone1', $CFG->defaultcity);
        }

        $mform->addElement('text', 'msn', get_string('msnid'), 'maxlength="120" size="20"');
        $mform->setType('msn', PARAM_TEXT);
        if (!empty($CFG->defaultcity)) {
            $mform->setDefault('msn', $CFG->defaultcity);
        }

        $mform->addElement('text', 'institution', get_string('institution'), 'maxlength="255" size="20"');
        $mform->setType('institution', PARAM_TEXT);
        if (!empty($CFG->defaultcity)) {
            $mform->setDefault('institution', $CFG->defaultcity);
        }

        $mform->addElement('text', 'department', get_string('department'), 'maxlength="255" size="20"');
        $mform->setType('department', PARAM_TEXT);
        if (!empty($CFG->defaultcity)) {
            $mform->setDefault('department', $CFG->defaultcity);
        }


Thanks!