Magento template path hints

Hi everyone, I believe this is one of the most popular tools you need when developing a Magento store even if you are a developer or store owner. Magento already has a feature which allows you to turn on template path hints in frontend. So, it is easy. But how to show template path hints in backend. Is it really "magic"? Well, no it is also an easy one.

Turn on template path hints in frontend

You can turn on this feature for a specific store view and it can be done in backend. Log in Magento backend and go to System > Configuration > Developer and find in Debug tab. Template Path Hints option is only shown after you switch to the store view which you want to enable it. Uncheck "Use Website" checkbox and select yes for the drop down next to Template Path Hints. Click Save Config and refresh your frontend. See, you can find path to your template files now.

Template path hints in backend

Ok, this is only necessary sometimes when you need to make changes in backend. You cannot do it by turning on / off in backend but a small piece of code.

				1
				1

You can put this piece of code in any config.xml file. Simply, you can add it into config.xml file which can be found in app/etc. Remember to remove them after you finish debugging. Enjoy coding!

One thought on “Magento template path hints”

1 Response to Magento template path hints

  • Roy O'Bannon
    Roy O'Bannon on August 30, 2012 at 11:07 am said:

    I followed your tutorial and found out some useful things.
    I started with researching what your config mean. When I looked at the table "core_website", and saw that there are 2 rows, one is admin, and one is base, so I thought that "base" means frontend side. Then I looked at table "core_config_data" after setting the frontend path hints to enabled, I saw 2 rows about path hints config. So, I understood about your config. By this way, you can enable path hint for frontend side or any "website" that defined in table "core_website" just in your config file. For example, if you want to turn on and off path hint in whole "site" (both fontend and admin side) just with commenting a part of config file, use this code :
    <pre class="brush: js"><websites>
    <admin>
    <dev>
    <debug>
    <template_hints>1</template_hints>
    <template_hints_blocks>1</template_hints_blocks>
    </debug>
    </dev>
    </admin>
    <base>
    <dev>
    <debug>
    <template_hints>1</template_hints>
    <template_hints_blocks>1</template_hints_blocks>
    </debug>
    </dev>
    </base>
    </websites></pre>
    Remember to delete the value in the config table, it doesn't work if you have values about this in config table.
    If you have another "site" in core_website table and want to enable path hints for it, do it the same as we did.
    for example :
    <pre class="brush:php"><another_site>
    <dev>
    <debug>
    <template_hints>1</template_hints>
    <template_hints_blocks>1</template_hints_blocks>
    </debug>
    </dev>
    </another_site></pre>
    Ok? That's all. Thank Neo for your useful article.

Comments