【问题标题】:Show template path in admin panel magento在管理面板 magento 中显示模板路径
【发布时间】:2014-08-06 17:45:34
【问题描述】:

我正在使用 magento 管理面板,我想像前端一样使用模板路径,我通过安装扩展进行了尝试,但它不起作用。请告诉我该怎么做?

【问题讨论】:

  • 接受您认为有帮助的给定答案之一。它对其他人也有用

标签: magento


【解决方案1】:

转到

app > code > core > Mage > core > etc > system.xml

第 512 行

你可以看到这个

<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>0</show_in_default>
      <show_in_website>1</show_in_website>
      <show_in_store>1</show_in_store>
</template_hints>

&lt;show_in_default&gt;更改为1并保存。

然后转到管理面板system &gt; configuration &gt; developer &gt; Debug启用路径提示。

干杯

【讨论】:

  • 您在指定的路径中有小错误。应该是app &gt; code &gt; core &gt; Mage &gt; core &gt; etc &gt; system.xml
【解决方案2】:
INSERT INTO `core_config_data` (`scope`, `scope_id`, `path`, `value`)
       VALUES ('websites', '0', 'dev/debug/template_hints', '1');

运行以下查询:

启用:

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 = 0 where scope = 'default' and scope_id = 0 and path ='dev/debug/template_hints'

完成后删除记录或如上所述设置值 0。不要忘记删除缓存

【讨论】:

  • 那么如果我们想再次关闭提示,我们是否需要触摸 DB 中的同一张表??
【解决方案3】:

在您的数据库中运行此查询

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

【讨论】:

    【解决方案4】:

    只需使用这个查询:

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

    现在,要从管理面板中删除这些模板路径,只需触发以下两个查询:

    delete from core_config_data where scope='default' and scope_id=0 and path='dev/debug/template_hints_blocks' and value=1
    

    delete from core_config_data where scope='default' and scope_id=0 and path='dev/debug/template_hints' and value=1
    

    并删除缓存插入查询和删除查询。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-05-08
      • 2017-12-17
      • 2012-07-18
      • 1970-01-01
      • 2021-11-20
      • 2016-04-16
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多