I am trying to figure out which template file is used in a page and I stumbled upon this variable to enable in the setting.php

$conf['theme_debug'] = TRUE;

I did enable the variable in the settings.php and in default.settings.php (what is the difference actually?), but with no luck on seeing the generated output in the markup. And of course cleared the caches several times.

So am I really blind to the generated output? Where does it actually generates?

  • Have you installed and used the Devel module -- drupal.org/project/devel ? It provides an inspector overlay which shows where things are coming from and suggests best-practices methods for overriding things. It would likely reveal the info you're looking for or at least provide a strong hint on where to look. – Anisha Shaikh Aug 26 '16 at 7:18
  • I was considering using Devel but for such a simple thing as finding which template is used I prefer using the theme_debug variable. – pierostz Aug 26 '16 at 7:23
  • try to add in services.yml in sites/default i.e copy example.services.yml rename it to sercivies.yml under twig.config: find debug: false make it true and flush caches and you are good to go – harsh_behl_0007 Aug 26 '16 at 7:32
  • 1
    @harsh I think you are talking about Drupal 8 – pierostz Aug 26 '16 at 8:08
  • The theme debug mode add HTML comments directly in the source of your page. You have to inspect or view source of your website to see it. Have a look at the Working with template suggestions page. – TytooF Aug 27 '16 at 8:46

Permissions issue. That simple. And I wasn't noticing it.

setting.php file has read only permissions (444) by default. So I changed to 644 permissions and that's it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.