2

Is there a plugin or setting that prints the name of every template being rendered in HTML comments? I noticed this type of feature in a Drupal project and it was useful for debugging.

This is useful if you add it to every template you make, but I'd like to be able to turn it on/off globally for all templates in dev mode: How can I make a template output its own filename?

Lindsey D
  • 23,974
  • 5
  • 53
  • 110
missmatsuko
  • 113
  • 8

2 Answers2

12

So this sounded like a fun problem to solve... so I wrote the Template Comments plugin that does what you want:

This free plugin adds a HTML comment to demarcate {% block %}s and each Twig template that is included or extended.

andrew.welch
  • 11,551
  • 22
  • 31
1

I think the answer is "no". There is no config or existing plugin that adds the debugging information I want.

missmatsuko
  • 113
  • 8