7

Cannot Enable Template Path Hints for Storefront in Magento 2.3

Does anyone knows how to solve it?

6

Template path hint is disabled in Production mode

You need to first set it to development mode

php bin/magento deploy:mode:set developer --skip-compilation

After changing to developer mode you need to run static deploy on admin theme

php bin/magento setup:static-content:deploy --theme Magento/backend -f

Clean cache at the end

php bin/magento cache:clean

Note: If above solution didn't work for you then apply these commands

php bin/magento deploy:mode:set developer --skip-compilation
php -dmemory_limit=1G bin/magento setup:upgrade
php -dmemory_limit=1G bin/magento setup:di:compile
php -dmemory_limit=1G bin/magento setup:static-content:deploy -f
php bin/magento cache:clean

After this template path hint should be visible on admin :)

| improve this answer | |
2

I strongly discourage this method. Use it at your own risk. Only to be used on local system.

Open vendor/magento/module-developer/Model/TemplateEngine/Plugin/DebugHints.php (tested in 2.3.2)

write this code inside afterCreate function : (at the start, above the storecode line)

if(isset($_GET['shreyasPathHints']) && $_GET['shreyasPathHints'] == 'on'){
    return $this->debugHintsFactory->create([
        'subject' => $invocationResult,
        'showBlockHints' => 1,
    ]);
}

Now, you can open any Magento page and append ?shreyasPathHints=on to the URL. No need to run any commands.

| improve this answer | |
1

Enable template path hints from Magento Admin >> Stores >> Configuration >> Advanced >> Developer.

After enabling, append "templatehints=magento" in URL like "http://localhost?templatehints=magento" and it will show template path hints.

| improve this answer | |

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