I created a new content type using Drupal 8 with the machine name "reviews." I thought that by duplicating the original content type template file, node.html.twig, and renaming it node--reviews.html.twig, I would be able to override the original template.
However, any new change is not reflected when I open any of my review pages. I have already cleared the cache.

What is the correct way to override the default template file?

  • did you put it the the templates folder? – No Sssweat Jun 29 '16 at 3:44

node--reviews.html.twig is correct. In my current theme, I have node--staff.html.twig and node--video.html.twig; they work perfectly fine. It could be a cache issue or probably a spelling issue.

|improve this answer|||||
  • You got it, it was a spelling issue LOL. I needed to name the file node--review.html.twig instead of node--reviews.html.twig (without the "s"). Thank you. :) – GTS Joe Jun 29 '16 at 6:28
  • Great! you should also have a look at Display Suite and the Panels Module....They making managing different variations/displays of your content far easier. – gilronc Jun 29 '16 at 18:31

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.