2

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

1 Answer 1

3

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

2
  • 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.
    – leymannx
    Commented 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.