Template path comments
This page is for designers who look at a page and need the template behind a piece of it. With template path comments on, every rendered template is wrapped in two HTML comments naming its file. The feature page is Template path comments.
Contents
Switch it on
On a test siteaccess:
# settings/siteaccess/<test siteaccess>/site.ini.append.php
[TemplateSettings]
ShowTemplatePathComments=enabledthen clear the template cache (php bin/php/ezcache.php --clear-tag=template), because compiled templates carry the
check. The Exp debug bar can toggle the same setting.
Read it
<!-- START design/media/templates/pagelayout/footer.tpl -->
...the footer markup...
<!-- STOP design/media/templates/pagelayout/footer.tpl -->When an override answered, the requested template is named in brackets:
<!-- START design/media/templates/node/view/full/article.tpl (node/view/full.tpl) -->"the file article.tpl answered the request node/view/full.tpl". In the browser's element inspector, the comments
appear around the elements, so you can climb from any element to its template.
Cautions
- Development only: the comments add markup to every template, break JSON, XML and RSS output, and reveal file paths.
Keep the setting
disabledon live siteaccesses (its comment insettings/site.inisays the same). - Cached output keeps the comments it was rendered with: clear content and template caches after switching.
Related pages
- Template debugging
- Debugging a design
- Free documentation: this page is free to copy, translate and improve under the GNU FDL 1.3.
Become an Exponential Partner
Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.