11
  • In my case, after enable the path Hints, from magento2 back-end section, its not showing. I enabled the settings in.

    Store > Configuration > Advanced > Debug > Enabled Template Path Hints for Storefront > Yes

    Can anyone tell me how fix this ?

    enter image description here

6
  • Yes, I already select to scope .but it seems not fixed. Nov 2 '17 at 8:59
  • Are you in production mode ? Nov 2 '17 at 9:00
  • No,working on local server. Nov 2 '17 at 9:03
  • You need to set Default Store view instead of Main website in your current scope. Nov 2 '17 at 9:06
  • 3
    m2.3 use storurl/?templatehints=magento
    – matinict
    Mar 27 '19 at 7:47
16

As @matinict mentioned in his comment, in Magento 2.3 you need to append ?templatehints=<Parameter Value> in your URL and your magento should be on Developer mode.

So your url will be look like as following:

http://localhost?templatehints=magento

and for any particular page URL will be like that

http://localhost/checkout/cart/?templatehints=magento

enter image description here

1
  • it works for me
    – Alam Zaib
    Aug 22 '19 at 5:23
13

For future googlers - I had this same problem on a site that had the core Magento data migrated over from an M1 store I had no control over. The problem turned out to be an IP address in the developer client restrictions input. This overrides template hints.

developer ip restrictions input in Magento 2 admin area

6
  • 1
    This worked for me. Dec 19 '18 at 10:10
  • 1
    Thanks, this worked for me. May 13 '19 at 10:24
  • 1
    Does not work, it still not shows. Edit: I had to set the store view to my store view in the upper left. There were also IP's entered in it.
    – Black
    Oct 22 '19 at 8:09
  • 1
    @Black cool, this was also my case. Dec 17 '19 at 13:07
  • this worked for me Dec 28 '20 at 4:43
7

You need to set scope Default store view or your current store view. You have set Main Website in Current configuration scope.

enter image description here

After set Current configuration as YOur Default store view and check Yes for storepath hints for front and Blockpath hints as Yes.

1
2

If you are using Magento 2.2 then on production mode, the template hint will not work.

Also, you need to check the setting at last level of scope mean store view scope.

3
  • How to view Template Path Hints for Storefront in Production Mode?
    – zus
    Oct 14 '20 at 3:42
  • You cannot do at Production. Need to some customization
    – Amit Bera
    Oct 14 '20 at 6:17
  • Can i get any idea how to do the customization regard path hints?
    – zus
    Oct 14 '20 at 6:29
2

Curiously. Now it works. Added a new block on the site and once again cleared the cache.

0
1

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.

1

I'd like to put in my two cents as well. After scratching my head about why template hints weren't being displayed even though the setting is enabled, I eventually discovered that the ?templatehints={key} bit does not work with urls that include pagination, eg:

https://devserver1234.nxcli.net/mycategory.html?p=1?templatehints=magento

In this case, you would need to remove the ?p=1 portion of the url.

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.