Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Would like the ability to enable twig debugging options (normally set in the settings.php) to be in the UI.
Comments
Comment #1
tlattimore CreditAttribution: tlattimore commentedWhere would this config page go? Under
admin/config/development/twig
maybe?Comment #2
chrisjlee CreditAttribution: chrisjlee commentedYeah that seems like that would make the most sense. That would be where i would look first.
Comment #3
tlattimore CreditAttribution: tlattimore commentedI'll take a stab at this.
Comment #4
tlattimore CreditAttribution: tlattimore commentedComment #5
star-szrComment #6
webchickI'd like to promote this to a major task from a feature request. Wanting to customize the look and feel of your site is basically the first or second thing all Drupal folks are going to want to do. Telling people more familiar with markup than PHP who just downloaded a CMS to start digging around in a PHP configuration configuration file and editing it sounds like not a great intro to Drupal 8 theming. ;)
Comment #7
star-szr@mdrummond mentioned the idea of putting this somewhere under Appearance, maybe /admin/appearance/settings?
If we think about easing the transition into Drupal theming then exposing this in the UI might make sense. @mdrummond and I chatted briefly about this in IRC and Marc brought up the site builder and their introduction to the theme system.
Comment #8
mortendk CreditAttribution: mortendk commentedi know were not supposed to do +1 on issues but this is a + 100 ;)
And yes put it in the theme settings where it belongs :)
Comment #9
forestmars CreditAttribution: forestmars commentedThis really belongs under config/development/twig, not so much theme settings (imo.)
Comment #10
forestmars CreditAttribution: forestmars commentedAlso, if we're going to put debug in UI settings, is there a good reason not to just go ahead and include cache and auto-reload?
Comment #11
star-szrThey are almost never needed so IMO no reason to expose them in the UI. twig_debug includes twig_auto_reload, and I've yet to have a need disable twig_cache.
https://drupal.org/node/1903374
Comment #12
BerdirThis is a setting. Changing those requires write access to settings.php, something we even verify on hook_requirements() to not have.
So, to make the UI work, you first need to go the file system, make the file writable, then go back to the UI and change the setting. That doesn't make much sense.
=> Instead, why not simply have a UI that displays the current settings and says, go to settings.php to change it? We're doing this now with the file public path too.
Comment #13
star-szrThat seems quite reasonable to me. Thanks for weighing in @Berdir!
Comment #14
star-szrWorth noting that the landscape here has changed somewhat since we have example.settings.local.php which does other helpful things for people working in the theme layer, most notably disabling the render cache.
Comment #15
dawehnerNow that this is part of the services.yml file it would be at least somehow possible to implement it.
Comment #16
star-szr@dawehner - would that be by reading/writing the settings in services.yml or some other way?
Comment #17
BerdirI'm not sure how @dawehner sees it, but we can't any better or worse into the services.yml than we did to settings.php. And not sure about the alternative, that would require a ServiceProvider that alters the container and reads those values directly from configuration, but that is a) very ugly at such a low bootstrap level and b) how do you know if it hasn't been overwritten in services.yml and which one wins?
Comment #18
star-szrComment #19
joelpittetMoving to 8.1.x since we are in RC
Comment #20
dawehnerWell, they how I see it is to store the data temporarily so it can be accessed during the container rebuild. For example what you could do is to store the configuration is the state subsystem in the form, then trigger a container rebuild and access the information from there.
Well I think you would simply assume that the UI wins, I'm sorry, but this option simply never makes sense in production, so people should do the right things.
Comment #21
joelpittetUnpostponing, 8.1.x is in sync with 8.0.x
Comment #22
dawehnerIMHO this is a feature.
Comment #37
mherchelClosing this as outdated now that #3278493: Make it easier for theme builders to enable Twig debugging and disable render cache is committed 🙌