Problem/Motivation

When Drupal's Twig debugging feature is turned on, the Components module should output debugging comments too.

The debugging comments should list:

  • The namespace-based reference to the template, e.g. @namespace/path/template.twig
  • The file path to the template, relative to the Drupal root.
<!-- THEME DEBUG -->
<!-- TWIG TEMPLATE: '@namespace/path/template.twig' -->
<!-- BEGIN OUTPUT from 'themes/custom/example/namespace/path/template.twig' -->
[ template contents ]
<!-- END OUTPUT from 'themes/custom/example/namespace/path/template.twig' -->

Issue fork components-3216184

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

JohnAlbin created an issue. See original summary.

DieterHolvoet made their first commit to this issue’s fork.

DieterHolvoet’s picture

Status: Active » Needs review

I implemented this feature, but with a slightly different comment structure in order to make the difference between core and components debug comments clearer:

<!-- THEME DEBUG -->
<!-- COMPONENT: @namespace/path/template.twig -->
<!-- BEGIN OUTPUT from 'themes/custom/example/namespace/path/template.twig' -->
[ template contents ]
<!-- END OUTPUT from 'themes/custom/example/namespace/path/template.twig' -->