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

CC BY-SA 4.0
2018-10-02T21:16:34.517Z
The answer is now "yes" (see above) :)
andrew.welch
CC BY-SA 4.0
2018-10-01T05:17:33.613Z
2018-10-01T05:17:33.613Z
missmatsuko
<p>So this sounded like a fun problem to solve... so I wrote the <a href="https://github.com/nystudio107/craft-templatecomments" rel="noreferrer">Template Comments</a> plugin that does what you want:</p>

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

CC BY-SA 4.0
2018-10-03T03:42:42.843Z
Wow that's awesome! Thank you! I'll try it out on my next project!
missmatsuko
CC BY-SA 4.0
2018-10-03T04:15:30.807Z
Lmk how it works for you. If you find any issues, file them on GitHub: https://github.com/nystudio107/craft-templatecomments/issues
andrew.welch
CC BY-SA 4.0
2018-10-02T15:54:02.377Z
2018-10-02T15:54:02.377Z
andrew.welch
<p>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.</p>

<p>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:
<a href="https://craftcms.stackexchange.com/questions/449/how-can-i-make-a-template-output-its-own-filename">How can I make a template output its own filename?</a></p>

<plugins><debugging>
How can I print the name of every template being rendered in HTML comments, when in devMode?
# How can I print the name of every template being rendered in HTML comments, when in devMode?

(Asked by: username_0 on 2018-09-20)

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?](https://craftcms.stackexchange.com/questions/449/how-can-i-make-a-template-output-its-own-filename)

**Tags:** plugins, debugging

---

## 2 answers

### Answer by username_1 on 2018-10-02. Score: 12 | Accepted answer

So this sounded like a fun problem to solve... so I wrote the [Template Comments](https://github.com/nystudio107/craft-templatecomments) 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.

> **Comments:**
> **username_0**: Wow that's awesome! Thank you! I'll try it out on my next project!  
> **username_1**: Lmk how it works for you. If you find any issues, file them on GitHub: https://github.com/nystudio107/craft-templatecomments/issues  

---

### Answer by username_0 on 2018-10-01. Score: 1

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

> **Comments:**
> **username_1**: The answer is now "yes" (see above) :)  

---

