On my development, local site (twig debug enable, cache disable), I create node template for specific view block by Drupal suggestions:

<!-- THEME DEBUG -->
<!-- THEME HOOK: 'node' -->
   * node--view--promoted-content--block-promoted-content.html.twig
   x node--view--promoted-content.html.twig
   * node--7398--teaser.html.twig
   * node--7398.html.twig
   * node--news--teaser.html.twig
   * node--news.html.twig
   * node--teaser.html.twig
   * node.html.twig
<!-- BEGIN OUTPUT from 'themes/custom/anime24/templates/content/node--view--promoted-content.html.twig' -->

And exactly: node--view--promoted-content.html.twig, and all seams to work perfectly:

enter image description here

But when I move site to production (standard hosting, disable twig debug, enable cache), Drupal ignore my node--view--[machine-name].twig.html templates, and load node--teaser.html.twig:

enter image description here

It looks like some weird cache issue, because, when I reload one of Block with AJAX filter, it loads an proper twig template:

enter image description here

And after click:

enter image description here

Has anyone encountered this error and is able to help me with the solution?


  • Did you flush all cache? – No Sssweat Jan 25 '19 at 0:40
  • Yes. I try default cache cleaner, devel cache cleaner, I remove files from sites/default/files/php/twig and clear database cache_ tables. Drush unfortunately not working on my server. – Dariusz Chowański Jan 25 '19 at 9:57
  • and you have double checked that the file is inside your active theme's /templates folder and that the file in the server does contain the correct HTML code? Could be a rare case that your FTP is not overriding the file. – No Sssweat Jan 25 '19 at 13:11

Browse other questions tagged or ask your own question.