Enable template path hint in admin pages - Magento

后端 未结 9 1109
时光取名叫无心
时光取名叫无心 2020-12-07 16:18

I want to enable template path hints in admin panel. I know how to do it for the front end, but for back end?? I actually want to edit the admin panel .

Thanks in a

相关标签:
9条回答
  • 2020-12-07 16:26

    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>
    
    0 讨论(0)
  • 2020-12-07 16:28

    You can enable template and block path hints in every store (including the admin store) by setting them in the Magento configuration. To do this, simply edit your module's configuration file config.xml (which gets injected into Magento's global configuration).

    To enable template and block path hints in the admin area add this to your 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 path hints simply change to 0, or delete the node.

    0 讨论(0)
  • 2020-12-07 16:34

    The feature wasn't designed to be used on the admin. Its system config is explicitly set to only allow you to se this at the website or store level, not the global level.

    Assuming this is just for work in a development environment, the approach I'd take would be to override the class

    Mage_Core_Block_Template
    

    and override (with a class alias override, or a local/Mage replacement) the getShowTemplateHints method hints.

    public function getShowTemplateHints()
    {
         //return false
         return true; 
    }
    
    //     old method, here for demo purposes only.  Don't hack the core
    //     public function getShowTemplateHints()
    //     {
    //         if (is_null(self::$_showTemplateHints)) {
    //             self::$_showTemplateHints = Mage::getStoreConfig('dev/debug/template_hints')
    //                 && Mage::helper('core')->isDevAllowed();
    //             self::$_showTemplateHintsBlocks = Mage::getStoreConfig('dev/debug/template_hints_blocks')
    //                 && Mage::helper('core')->isDevAllowed();
    //         }
    //         return self::$_showTemplateHints;
    //     }
    

    You can then manually change getShowTemplateHints to return true or false if you want the feature on or off, or add whatever additional logic you wanted.

    I would not recommend you push this change to the production server.

    0 讨论(0)
  • 2020-12-07 16:37

    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.

    0 讨论(0)
  • 2020-12-07 16:43

    You can use the following extension in order to enable the template path hints for frontend & backend easily & securly in a joomla way:
    http://www.magepsycho.com/easy-template-path-hints.html

    0 讨论(0)
  • 2020-12-07 16:45

    I don't think you should make it too difficult, let 's make it easy by easy steps. You can look at the instruction here about How to turn on template path hints in Magento

    0 讨论(0)
提交回复
热议问题