Adding Registration Fields

hello i m new to elgg and bit new to PHP also. ( Basic Knowledge of PHP ) i want the custom Registration field in website when user comes to signup? i want to:-

First & Last Name

and then register button
how can i add this to the register page and form.
Username field & Repeat Password field is not there ( above )
so here First & Last name get replaces by => Display name ( above register form )
how to get rid of Display Name in profile ( user profile form ) to => First & Last Name
and in Log in Form
there is => Username or email but i want only => Email
how to do all above things?
i m strugging with this from few days but now i posted here.
  • You can use the profile manager plugin to add new fields to the registration form.

    The display name and username/email you can simply overwrite the language strings.


    Basically, create a new plugin with a language file - and create an entry for the keys that control that output.  The core language file can be found in languages/en.php (don't modify it directly, but you can use it find the strings you need to overwrite)


  • i have use Profile Manager for this but how can i get rid of extra Fields in register page other than i have above

  • how to remove Username field & Repeat Password field from Reister page with profile manager

  • That you won't be able to do with profile manager.

    The username is very integral for elgg, and having a repeat password will save a lot of annoyances when people register and mistype it and can't log in again the next time.

    That said, it can be done, you're just going to have to get your hands dirty.  Here's a relevant thread, make sure to read it all:


  • As Matt said:

    • Create a new plugin, do not modify the core.
    • Override the /views/default/forms/register.php. Erease the email and passwordagain fields (39-47 and 58-65 lines).
    • Override the actions/register.php.
    • Change $username = get_input('username'); by $username = str_replace('@', '_', get_input('email')); (line 12)
    • Change $password2 = get_input('password2', null, false); by $password2 = $password;

    This will be enough, as you can see, you need to change the registration form and the action associated to it. The action gets the username and the password2 from the email (replacing the @ by a _) and password1, respectively.

  • hey, sem thanks for help but above code in action/register.php

    • Change $username = get_input('username'); by $username = str_replace('@', '_', get_input('email')); (line 12)
    • Change $password2 = get_input('password2', null, false); by $password2 = $password;

    give error like => Password field cannot be empty

    please help.

  • if you read the thread I posted above, you don't need to overwrite action/register

    create the hook as shown in the thread to extend the action

    generate your username and set it as an input just like in the thread

    the only other thing you should need is to remove the second password

    $password = get_input('password', null, false);

    set_input('password2', $password);

  • ok i will do that and let you know the results.