Home >How To Enable Template Path Hints – Two Best Ways!

How To Enable Template Path Hints – Two Best Ways!

Hello everyone,

Welcome to another tutorial of ours.

In today’s article, we will show you how to enable Template Path Hints – a very helpful function in Magento 2.

Let’s get going!

Why Do You Need To Enable Template Path Hints?

In Magento 2, when you want to edit a specific block but don’t know where the template of the block is, you can use template path hints.

This feature is a diagnostic tool that adds notation with the path to each template that is used on the page. It can be enabled for the frontend or backend.

There are two ways to enable it: 

  • Using admin configuration
  • Using command line

Enable template path hint in admin configuration

Follow the step-by-step tutorial below to enable the path hints feature for the storefront and for admin.

Note: This function is only available when enabling the developer mode.

Enable for Storefront

Step 1: Log in to the admin.

Step 2: Go to Store > Configuration > Advanced > Developer > Debug > Enable Template Path Hints for Storefront.

Step 3: Click Yes to enable the feature (If you want to display block class, choose Yes to Add Block Class Type to Hints).

template-path-storefront

Step 4: Delete cache and verify the changes.

storefront

Enable for admin

Step 1: Log in to the admin.

Step 2: Go to Store > Configuration > Advanced > Developer > Debug > Enable Template Path Hints for Admin.

Step 3: Click Yes to enable the feature (If you want to display block class, choose Yes to Add Block Class Type to Hints).

template-path-admin

Step 4: Verify the changes.

admin

Enable template path hints using command line

You can enable or disable path hints using the following command lines:

  • Enable: php bin/magento dev:template-hints:enable
  • Disable: php bin/magento dev:template-hints:disable

Then using this command line to delete cache: php bin/magento cache:flush

Conclusion

We hope that this article is helpful for you to learn how to enable Template Path Hints.

Please Like, Share and Comment to let us know your opinion or any suggestions for this article.

BSS Commerce is one of the leading Magento extension providers and web development services in the world. With experienced and certified Magento developers, we commit to bringing high-quality products and services to optimize your business effectively. Furthermore, we offer FREE Installation – FREE 1-year Support and FREE Lifetime Update for every Magento extension.

CONTACT NOW to let us know your problems. We are willing to support you every time.

< Previous Post
Next Post >
+ posts