Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 299219

Twig settings implementation: Show theme hook / template suggestions in HTML comments

$
0
0

A follow-up to #1843034: Make Twig settings configurable, when debug is enabled, let's add our own custom debugging output as HTML comments wrapped around the template. The debugging output helps themers determine which template is being rendered, which theme suggestions are available and which theme /template suggestion has been selected for each piece of theme output.

Something like this:

<!-- THEME DEBUG -->
<!-- CALL: theme('node') -->
<!-- FILE NAME SUGGESTIONS:
   * node--article.html.twig
   * node--2.html.twig
   x node.html.twig
-->
<!-- BEGIN OUTPUT from 'core/modules/node/templates/node.html.twig'  -->
<article id="node-1" class="node node-article promoted view-mode-full clearfix" role="article" about="/node/1" typeof="sioc:Item foaf:Document">
  <p>(content)</p>
</article>

<!-- END OUTPUT from 'core/modules/node/templates/node.html.twig' -->

Viewing all articles
Browse latest Browse all 299219

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>