2

How to create template of user register, login and forget password in drupal 8 can we create template same as we created earlier in drupal7 ?

I want to open these forms in popup on clicking links

7

Yes it same as drupal 7.

For example:

We are using page--user--register.tpl.php for registration page template in D7. In D8 changed to twig extension page--user--register.html.twig.

You can enable debug mode in D8 so you can easily see the twig file need to use in your case. You can refer Drupal 8 custom page template to see how to enable debug mode.

enter image description here

Some links how to override the template files.

https://www.drupal.org/node/2521876

https://www.drupal.org/docs/8/theming/twig/working-with-twig-templates

https://www.drupal.org/node/2668886

| improve this answer | |
  • 1
    can we create template as user_login_form.html.twig except page--user--register.html.twig,if its possible so how to proceed – user59414 Nov 15 '16 at 10:06
  • 1
    Yes you need to check how to add a custom template file for user registration. – DRUPWAY Nov 15 '16 at 10:09
  • 1
    do you have any link ? – user59414 Nov 15 '16 at 10:11
  • 3
    This link give you an idea how to override a template drupal.org/docs/8/theming/twig/working-with-twig-templates – DRUPWAY Nov 15 '16 at 10:18
  • 1
    one more thing we use this code in drupal 7 for creating custom template 'user_login' => array( 'render element' => 'form', 'template' => 'templates/user-login', ), – user59414 Nov 15 '16 at 11:55
0

for your case answer is page--user--register.html.twig, but generally, you can use below twig template naming suggestions:

page--user.html.twig
page--user--login.html.twig
page--user--password.html.twig
page--user--register.html.twig

I suggest you use page--user.html.twig, for all of these pages.

| improve this answer | |

Your Answer

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