I have enabled the templates hint for developer troubleshooting, but the hints not shown at frontend, do you know any reasons?
4 Answers
You can use these commands to enable/disable template path hints.
bin/magento dev:template-hints:enable
bin/magento dev:template-hints:disable
Flush the cache after enabling using bin/magento c:f
Sometime removing var files manually may also helps,
rm -rf generated/code/ generated/metadata/ var/cache/ var/view_preprocessed/ var/page_cache/
Update
And as per given snapshot of config, you have to add query string templatehints=magento
at the end in URL like this
http://yourdomain.com/?templatehints=magento
If you don't want to use this kind of query string and want to show template hints on each request, please change Enable Hints for Storefront with URL Parameter
to No
(don't forget to flush cache and run above rm
command after this config change)
-
-
-
yes, you're right. after add templatehints=magento to the url, the hints display. i never know this meaning, i learn it now. thanks. Commented Sep 6, 2022 at 8:40
-
Happy to hear that An up-vote and accepting answer will be appreciated if it is resolved by this answer. Commented Sep 6, 2022 at 9:07
Sometimes Path Hints won't be shown if:
- The URL does not contain the
templatehints
parameter. - Developer Client Restrictions has an IP addressed listed that isn't yours.
- The cache was not flushed after changing the option.
- The site was changed to Production mode.
Developer Client Restrictions can be check in Stores -> Settings -> Configuration
then Advanced -> Developer -> Developer Client Restrictions
. Check that the Allowed IPs
field is either blank, or contains your IP address.
-
Thanks, point #2 has flushed, #3 is developer mode, but #1 is interesting, i don't know this. what is developer client restriction, how can i find this out? Commented Sep 5, 2022 at 11:00
-
-
1@DennisChan just to be sure - did you add the value to the url to see the hints?– MarioCommented Sep 5, 2022 at 14:36
-
1yeah, finally find out the url requires a templatehints=xxxxx parameter to show the hints. many thanks. Commented Sep 6, 2022 at 8:43
-
@DennisChan It never occurred to me that perhaps the URL param was not included. I've amended the Answer with your tip. Thank you. Commented Sep 6, 2022 at 8:49
In my case the problem was lack of attention. basically I just disabled the IP Developer Client Restrictions->Allowed IPs setting. You can see the answer here: https://magento.stackexchange.com/a/374121/112377