Create user registration form¶
You can create a registration form for users to your website by creating a Twig template or editing the existing registration form in YAML file. Follow the instructions below to create and customize templates for a registration form, and a registration confirmation page.
First, make sure you enabled user registration.
Configure existing form¶
In your configuration, under allowed_field_definitions_identifiers configuration key, specify the fields that should be part of your registration form.
You can also define what kind of user you want to create under user_type_identifier, for example, frontend user.
To learn more about available users, see user types documentation.
1 2 3 4 5 6 7 8 9 10 | |
Add a form template¶
Add the following configuration under the ibexa.system.<scope>.user_registration configuration key:
1 2 3 4 5 6 7 | |
This defines which templates are used for rendering the registration form and confirmation page.
In the templates/themes/<theme_name>/user/registration_form.html.twig create the template for registration form.
Example registration form:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | |
In the templates/themes/<theme_name>/user/registration_confirmation.html.twig, create the template for confirmation form.
Example confirmation form:
1 2 3 4 5 6 7 | |
To add a link redirecting to the login form, in the page layout template, provide the following code:
1 | |