Magento template path hints for admin
In this tutorial I show you how to turn on path hints for admin sites. For Magento frontend developers it is very easy to work with Magento, because template path hints show exactly which block source comes from which template file. This useful feature is also available for your backend, but it has to be turned on from your databse.
Magento template path hints for admin
Magento template path hints for admin sites are turned on with this simple INSERT SQL statement:
1 | INSERT INTO `core_config_data`(`scope`,`scope_id`,`path`,`value`) VALUES ('websites','0','dev/debug/template_hints','1'); |
You have to open your phpmyadmin webinterface or any other mysql client program and run this query. This statement only works the first time. If dev/debug/template_hints was already added to your core_config_data, then you can activate template path hints by changing its value colum to 1. You have to reload a Magento admin site to see if it is working. If not, clear your cache. If it still shows no red dotted frames with red underlayed template filenames, then you should check your database if this admin setting is overwritten by one of your storeviews.
Deactivate path hints
If your work is done, you have to deactivet Magento template path hints for admin again. This is done directly from you preferred mysql client. Just query for all dev/debug/template_hints settings:
1 | SELECT * FROM `core_config_data` WHERE `path` LIKE 'dev/debug/template_hints'; |
change value to 0 (disabled) or 1 (enabled). Attention: if you find more than one entry than look at colum scope_id. It tells you which store this value belongs to. 0 is standard or admin setting, but there my be others at storeview level. A 0 at a Storeview overwrites you 1 at admin stage.
Problems to display path hints?
If you still do not see any template path hints in your backend, you can also set this database changes by xml files.
1 2 3 4 5 6 7 8 9 10 11 12 13 | <config> ... <stores> <admin> <dev> <debug> <template_hints>1</template_hints> <template_hints_blocks>1</template_hints_blocks> </debug> </dev> </admin> </stores> </config> |
or you can do it on website level like shown in my database screenshot:
1 2 3 4 5 6 7 8 9 10 | <websites> <admin> <dev> <debug> <template_hints>1</template_hints> <template_hints_blocks>1</template_hints_blocks> </debug> </dev> </admin> </websites> |
Conclusion
It is easy to switch on template path hints for your Magento backend. This is only possible with a new database setting. There is no switch which can be turned on in you admin backend. In you app/etc/local.xml you can add: