Enable template path hint in admin pages - Magento

后端 未结 9 1141
时光取名叫无心
时光取名叫无心 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:50

    A quite handy solution: Modify getShowTemplateHints() function defined in \app\code\core\Mage\Adminhtml\Block\Template.php file as below:

    To run below function: In your browser type, http://www.mymagentosite.com/?th=1&token=PHP

    You can see template hints and added Block Names.

    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();
        }
    
        // overwrite the template hint [SPECIALLY FOR SHOWING TEMPLATE PATH HINTS IN ADMIN]
        $th     = Mage::app()->getRequest()->getParam('th', false);
        $token  = Mage::app()->getRequest()->getParam('token', false);
        if($th == 1 && $token == 'PHP'){
            self::$_showTemplateHints = true; // for template path
            self::$_showTemplateHintsBlocks = true; // block names
        }
    
        return self::$_showTemplateHints;
    }
    

提交回复
热议问题