How do I change the Drupal 8 frontpage template, so it doesn't use the regular page.html.twig template?

  • Hi! Welcome do DA. :) I took quite a few liberties with editing the question, I hope I still kept the core of it intact. Otherwise feel free to revert or edit again, but please try to keep the text short and to the point. Regarding answering your question, I don't know, but I notice that the views module has a views-view--frontpage.html.twig file. Following that patterns, it's possible that the the correct template name would be frontpage.html.twig. You might want to try. Other templates in core are named with a - separating their name from page, so perhaps front-page.html.twig?
    – Letharion
    Commented Nov 7, 2014 at 8:37
  • I added all those files to my templates folder in my theme and still it shows the page.html.twig instead of those i cleared the cache too before reloading the page.
    – Stefan
    Commented Nov 7, 2014 at 8:52

1 Answer 1


Enable twig_debug and you will see HTML comments surrounding the output that tell you what template suggestions are available. In this case you will get output like:

<!-- THEME DEBUG -->
<!-- THEME HOOK: 'page' -->
   * page--front.html.twig
   * page--node.html.twig
   x page.html.twig
<!-- BEGIN OUTPUT from 'core/modules/system/templates/page.html.twig' -->

Naming your template page--front.html.twig will use that template for only the homepage.

  • how does this work with subfolders? E.g. having a folder page in my templates directory.
    – ferdynator
    Commented Sep 11, 2015 at 10:51
  • @ferdynator it works just fine, you can add subfolders to organize your templates.
    – star-szr
    Commented Sep 16, 2015 at 19:32
  • 2
    This won't be picked up until you clear your caches, of course (said the newbie)!
    – Deborah
    Commented Nov 23, 2016 at 8:52

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.