How to Enable Template Path Hints for Magento Admin Panel

In Magento 1, we can enable template path hints for frontend by using admin system configuration, but there is no option on admin system configuration to enable template path hints for admin panel. But we can enable template path hints for admin panel through code.

Enable template and block path hints through Magento configuration file:

To enable template and block path hints for Magento admin area, add the below code in any of your custom module’s config.xml file.

<config>
    ...
    <stores>
        <admin>
            <dev>
                <debug>
                    <template_hints>1</template_hints>
                    <template_hints_blocks>1</template_hints_blocks>
                </debug>
            </dev>
        </admin>
    </stores>
</config>

To disable the path hints, simply change <template_hints>1</template_hints> to <template_hints>0</template_hints> and <template_hints_blocks>1</template_hints_blocks> to <template_hints_blocks>0</template_hints_blocks>, or delete this code.

Enable template and block path hints through layout.xml file:

To enable template and block path hints for Magento admin area, add the below code in the layout.xml file (Path of layout.xml file is /app/etc/local.xml).

<config>
    ...
    <websites>
        <admin>
            <dev>
                <debug>
                    <template_hints>1</template_hints>
                    <template_hints_blocks>1</template_hints_blocks>
                </debug>
            </dev>
        </admin>
    </websites>
</config>

To disable the path hints, simply change <template_hints>1</template_hints> to <template_hints>0</template_hints> and <template_hints_blocks>1</template_hints_blocks> to <template_hints_blocks>0</template_hints_blocks>, or delete this code.

Enable template and block path hints using database query:

To enable template path hints in your Magento admin panel, just run the following SQL query on the Magento database.

INSERT INTO core_config_data (scope, scope_id, path, value)VALUES ('default', 0, 'dev/debug/template_hints', 1),('default', 0, 'dev/debug/template_hints_blocks', 1);

When you’ve finished development and want to turn off template path hints in the admin panel, open the core_config_data table and change the value column of the two row you inserted to “0”. Otherwise you can simply run the following SQL query on your Magento database.

UPDATE core_config_data set value = 0 where scope = 'default' and scope_id = 0 and path ='dev/debug/template_hints';
UPDATE core_config_data set value = 0 where scope = 'default' and scope_id = 0 and path ='dev/debug/template_hints_b

Further if you want to turn on template path hints in the admin panel, open the core_config_data table and change the value column of the two row you inserted to “1”. Otherwise you can run the following SQL query on your Magento database.

UPDATE core_config_data set value = 1 where scope = 'default' and scope_id = 0 and path ='dev/debug/template_hints';
UPDATE core_config_data set value = 1 where scope = 'default' and scope_id = 0 and path ='dev/debug/template_hints_blocks';

Hope this helps.

Leave a Reply

Your email address will not be published. Required fields are marked *