We keep exploring the latest version of the most popular ecommerce development platform. In this article you are going to learn about different ways to enable and disable template path hints in Magento 2. Here you can see a brief list of frequently asked how-to questions that our Magento developers tried to cover in this article:
- How to enable template path hints via Admin panel?
- How to enable template path hints via command line?
- How to enable/disable template path hints via mysql for Storefront?
- How to enable/disable template path hints via mysql for Admin?
- How to enable/disable template path hints via env.php file?
Enabling template path hints via Admin panel
For storefront: Store > Configuration > Advanced > Developer > Debug > Enabled Template Path Hints for Storefront > Yes.
For Admin: Store > Configuration > Advanced > Developer > Debug > Enabled Template Path Hints for Admin > Yes.
Here how it looks like on the Admin page (click on the image to open it in full size):
After that we should clean the cache. Do it via the Admin panel: System > Tools > Cache Managment > Select All > Refresh > Submit.
Partner With Us
Let's discuss how to grow your business. Get a Free Quote.Or using the console:
1 |
php bin/magento cache:clean |
This is how our front is going to look like (click on the image to open it in full size):
The Admin page will look like this (click on the image to open it in full size):
Enabling Template Path Hints via Command Line
For Storefront
Disable frontend template hints:
1 |
php bin/magento dev:template-hints:disable |
Enable frontend template hints:
1 |
php bin/magento dev:template-hints:enable |
After that cache flush might be required:
1 |
php bin/magento cache:flush |
For Admin
Enabling and disabling frontend template hints is not possible for Admin in the current version Magento 2.2.3.
Magento Webdesign
Take your online store to the next level with BelVG Magento Webdesign
Visit the pageEnabling/Disabling Template Path Hints via mysql for Storefront
Scope contains the value Store View.
Scope will equal default for Default Store View. For Main Website, scope will equal websites.
Enable:
1 |
REPLACE INTO `core_config_data` (`scope`, `scope_id`, `path`, `value`) VALUES ('default', '0', 'dev/debug/template_hints_storefront', '1'); |
Disable:
1 |
REPLACE INTO `core_config_data` (`scope`, `scope_id`, `path`, `value`) VALUES ('default', '0', 'dev/debug/template_hints_storefront', '0'); |
Enabling/Disabling Template Path Hints via mysql for Admin
Enable:
1 |
REPLACE INTO `core_config_data` (`scope`, `scope_id`, `path`, `value`) VALUES ('default', '0', 'dev/debug/template_hints_admin', '1'); |
Disable:
1 |
REPLACE INTO `core_config_data` (`scope`, `scope_id`, `path`, `value`) VALUES ('default', '0', 'dev/debug/template_hints_admin', '0'); |
Enabling/Disabling Template Path Hints via env.php file
In case you cannot change the value via the Admin panel, as shown on the screenshot (click on the image to open it in full size):
search for the value in file app/etc/env.php
In this file you can change the value template_hints_storefront and template_hints_admin.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
<?php return array( ... 'system' => array( 'default' => array( 'dev' => array( 'debug' => array( 'template_hints_storefront' => '1', 'template_hints_admin' => '1' ), ), ), ), ); Run the following command after the changes: php bin/magento setup:upgrade |
That is how you deal with Template Path Hints in Magento 2. We hope these tips will be helpful and clear to you. If not, please ask your questions in the comment section.
To learn other useful tips on Magento 2 Development click here.
Need experienced Magento developers? BelVG can help!
Magento Development Services
Take your online store to the next level with BelVG module
Visit the store