In 7.33, the theme_debug variable and related functionality was introduced. This added an optional sitewide theme debug mode, to provide contextual information in the page's HTML to theme developers.

Outside of the release notes and other documentation on drupal.org, this variable and functionality are not very visible. This should be added to default.settings.php to make it easier to find and use.

Comments

rrrob’s picture

StatusFileSize
new857 bytes
cilefen’s picture

Issue tags: +Documentation
David_Rothstein’s picture

Status: Active » Needs review

Sounds like a good idea to me. Changing status so the issue can be reviewed.

For comparison here's how Drupal 8 documents it in sites/default/default.services.yml:

    # Twig debugging:
    #
    # When debugging is enabled:
    # - The markup of each Twig template is surrounded by HTML comments that
    #   contain theming information, such as template file name suggestions.
    # - Note that this debugging markup will cause automated tests that directly
    #   check rendered HTML to fail. When running automated tests, 'debug'
    #   should be set to FALSE.
    # - The dump() function can be used in Twig templates to output information
    #   about template variables.
    # - Twig templates are automatically recompiled whenever the source code
    #   changes (see auto_reload below).
    #
    # For more information about debugging Twig templates, see
    # https://www.drupal.org/node/1906392.
    #
    # Not recommended in production environments
    # @default false
    debug: false
rrrob’s picture

StatusFileSize
new917 bytes

Added link to documentation.

dawehner’s picture

Status: Needs review » Reviewed & tested by the community
+++ b/sites/default/default.settings.php
@@ -565,3 +565,20 @@ $conf['404_fast_html'] = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN"
+ *
+ * @see https://www.drupal.org/node/223440#theme-debug
+ *

We could use a similar description pointing out that this is documentation.

David_Rothstein’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 7.x - thanks!

I agree with @dawehner, so I fixed that part on commit:

diff --git a/sites/default/default.settings.php b/sites/default/default.settings.php
index abc0286..7e36a4a 100644
--- a/sites/default/default.settings.php
+++ b/sites/default/default.settings.php
@@ -576,7 +576,8 @@ $conf['404_fast_html'] = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN"
  * - Note that this debugging markup will cause automated tests that directly
  *   check rendered HTML to fail.
  *
- * @see https://www.drupal.org/node/223440#theme-debug
+ * For more information about debugging theme templates, see
+ * https://www.drupal.org/node/223440#theme-debug.
  *
  * Not recommended in production environments.
  *

  • David_Rothstein committed c2d06db on 7.x
    Issue #2538640 by rrrob, dawehner: Add theme_debug to default.settings....

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.