Enable template path hint in admin pages - Magento

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

    I know it's late but you can do it easily this way: Just change settings in the configuration file www/app/code/core/Mage/Core/etc/system.xml

    Set sections>dev>debug>fields>template_hints>show_in_default to 1 and set sections>dev>debug>fields>template_hints_blocks>show_in_default to 1 too

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

    Go to your Database and Just run this query:

    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);
    

    To disable them again, run this query:

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

    To enable again run this query:

    UPDATE core_config_data set value = 1 where scope = 'default' and scope_id = 0 and path ='dev/debug/template_hints'
    
    0 讨论(0)
提交回复
热议问题