I want to use a different template file for the registration form, but I don't want to use page--user--register.html.twig because in this case I should rewrite all the page structure. We had user-register.tpl.php in Drupal 7, but I couldn't find the theme name in Drupal 8.
1 Answer
I found the solution here: http://www.foreach.be/blog/how-manipulate-forms-drupal-8
and the file name for overriding the user register form is:
form--user-register-form.html.twig
-
It depends on what it is you actually want to override but I'ld recommend you'ld rather use
hook_form_alter()
instead. See api.drupal.org/api/drupal/… for example code.– leymannxCommented Apr 22, 2017 at 22:26 -
@leymannx yeah you are right, but I want to add HTML wrappers to form, and I know I can change field theme with this function.but thanks anyway for your info. Commented Apr 23, 2017 at 0:21