8

I want to ask that how to turn on template hints and template hint links in admin panel?

1
  • 4
    which version in magento1 or magento2? Sep 29, 2016 at 6:21

10 Answers 10

11

You can do it by changing the database directly. If you have something like phpMyAdmin that is a good way to gain access. Enter this SQL.

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

When you are done with path hints just delete the matching record from core_config_data Or update the value field to 0 instead of deleting the whole record, it will probably be the last one since you've just added it.

2
4

If it's for magento1.x then go to

app/code/core/Mage/Core/etc/system.xml

First take backup of this file and change below code

<template_hints translate="label">
    <label>Template Path Hints</label>
    <frontend_type>select</frontend_type>
    <source_model>adminhtml/system_config_source_yesno</source_model>
    <sort_order>20</sort_order>
    <show_in_default>1</show_in_default> <!--change this value to 1-->
    <show_in_website>1</show_in_website>
    <show_in_store>1</show_in_store>
</template_hints>

And change setting from System->Configuartion->Developer and set template path hint on change this on default level otherwise you cannot see hint on

Revert this file when you done

3

If you are a magento developer Modify

app/code/core/Mage/Core/Block/Template.php as below:

public function fetchView($fileName)
{
    .......
    .......
    //Commented to show the hints everywhere
    //Line #221
    //if ($this->getShowTemplateHints()) { 
        ......
        ......
        if (self::$_showTemplateHintsBlocks) { //Comment if you want to see the block hints
        ........
        ........
        } //Comment if you want to see the block hints
    //}
    .......
    .......
    //Line #251
    //if ($this->getShowTemplateHints()) {
    .......
    //}
}

DON'T FORGET TO REVERT THIS ONCE YOU ARE DONE

3
  • You should never edit the core files, even if you are a developer.! Sep 29, 2016 at 6:40
  • 1
    Normally I agree, but as long as it doesn't end up in version control, everything is fine :-) Sep 29, 2016 at 6:45
  • @Manashvibirla That's true if it is something required for a longterm run. In this case, this is just to view a file path and I don't see any mistake if the changes can be reverted in the local environment itself.
    – Nidheesh
    Sep 29, 2016 at 6:47
2

If it is Magento 2

Store > Configuration > Advanced > Developer > Debug > Enabled
Template Path Hints for Admin > Yes
3
  • The solution for Magento 1 enables the path hints for frontend, not admin panel. There is no configuration in magento 1 to enable path hints for admin Sep 29, 2016 at 6:30
  • Yes, i modified my answer. Sep 29, 2016 at 6:43
  • I have done this but not able to see template hints I am using 2.1.7 is there anything to append to url
    – siddhesh
    Jul 13, 2017 at 14:17
1

You can enable template hints for frontend and backend using extension "Easy Template Path Hints". It is beneficial in many ways as it provides hints of both admin and frontend. You can access hints by altering URL with certain keyword postfix after URL. There is no need to enable Magento default template hint.

https://www.magentocommerce.com/magento-connect/easy-template-path-hints.htmlts.html

0

If you want to enable template path hints in magento-1.9 version. You have two methods.

  1. First method:
System > Configuration > Current configuration scope (at top left) > change to main website > Advanced > Developer > Debug > Enabled
Template Path Hints for Admin > Yes
  1. Second method:

You can enable template hints for frontend and backend using extension "Easy Template Path Hints".https://www.magentocommerce.com/magento-connect/easy-template-path-hints.html

1
  • You must not have read the question. Your solution is for frontend hints and the question is about adminhtml.
    – HenryHayes
    Nov 20, 2021 at 11:46
0

In Magento2 go to core_config_data table, look for path dev/debug/template_hints_admin and set its value to 1.

UPDATE `core_config_data` SET `value` = '1' WHERE `path` = 'dev/debug/template_hints_admin'
0

There are 2 ways in which you can enable/disable magento admin pages template hints.

One through FTP & other through Database.

FTP : Edit the app/etc/config.xml

<config>

    ...

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

</config>

DATABASE: Insert these 2 rows into 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);

Here you have additional details about disabling or restoring the changes back.

0

open /app/etc/local.xml and add the follow code

<config>

    ...

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

or you can do with database tables as follows

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

0

All of the answers about temporarilym modifying the database are just the wrong thing to do.

I have always done this.

Locate this file:

/app/etc/local.xml

And add this to it:

<config>

    ...

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

I went one further than this and created an extension:

Start with the module xml file app/etc/modules/HenryHayes_AdminTemplateHints.xml:

<?xml version="1.0"?>
<config>
    <modules>
        <HenryHayes_AdminTemplateHints>
            <active>true</active>
            <codePool>community</codePool>
        </HenryHayes_AdminTemplateHints>
    </modules>
</config>

And then do this in the config file app/code/community/HenryHayes/AdminTemplateHints/etc/config.xml:

<?xml version="1.0"?>
<config>
    <modules>
        <HenryHayes_AdminTemplateHints>
            <version>1.0.0</version>
        </HenryHayes_AdminTemplateHints>
    </modules>
    <websites>
        <admin>
            <dev>
                <debug>
                    <template_hints>1</template_hints>
                    <template_hints_blocks>1</template_hints_blocks>
                </debug>
            </dev>
        </admin>
    </websites>
</config>

To switch it off set active to false in app/etc/modules/HenryHayes_AdminTemplateHints.xml:

<active>false</active>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.