1

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.

2

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

|improve this answer|||||
  • 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 Apr 22 '17 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. – mahmood.bazdar Apr 23 '17 at 0:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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