0

Version: Drupal 8.7.x

Currently, I am using a subtheme of the Bootstrap theme and I want to override the default login page because the interface doesn't look good. I was hoping to override the template file in Bootstrap theme responsible for login but there was no file with familiar name in the theme folder. Maybe Bootstrap inherited the login file as well? Then I created a file named page--user--login.html.twig and put that in my subtheme folder but there was no change in the login page. Maybe the file name is supposed to be different or it is something else entirely.

  • page--user--login.html.twig should work. The file should be located in my_theme/templates/page--user--login.html.twig - and make sure you clear the cache too. – 100pic Sep 6 at 0:38
  • Yes, I was using the same file name but as Stanley pointed out, you can check the filename by setting debug: true in services.yml. In my case the file I needed to create was page--login.html.twig – Aves2432 Sep 6 at 13:14
0

Go to

web/sites/default/services.yml

and change the debug value from false to true

debug: true

enter image description here

You will get file name suggestions like shown in the image, u should use the same names.

Also, was your sub-theme succesfully installed? Is the sub-theme under this path ? `

themes/custom/myproject_bootstrap_subtheme

`

  • 1
    Thank you so much.Yes my theme was working but the file name was wrong. In my case it was page--login.html.twig instead of page--user-login.html.twig. I checked the source code after doing debug: true as you instructed. Then I changed to appropriate filename – Aves2432 Sep 6 at 13:17

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.