【问题标题】:How to make a Magento extension to replace prototype.js w/ an alternate version in adminhtml only如何制作 Magento 扩展以仅在 adminhtml 中使用备用版本替换prototype.js
【发布时间】:2014-03-12 17:33:02
【问题描述】:

我只需要将备用 js/prototype1_6_0_3.js 文件调用到我的管理员中,并为用户/客户前端保留原始 js/prototype.js。我不得不快速将原始 js/prototype.js 文件升级到 1.7.0.1 b/c,以解决 IE10 执行其自动更新之一时弹出的问题。

目前我的扩展程序导致管理员大部分是空白的并且非常破碎。 有人可以指出我做错了什么。 谢谢。在这里输入代码

这是我想要做的:

app\design\adminhtml\default\default\layout\adminprototypeversion.xml

<?xml version="1.0"?>
<layout>
  <adminhtml>
    <reference name="head">
                <action method="removeItem"><type>js</type><name>prototype/prototype.js</name></action>
            <action method="addJs"><script>prototype/prototype1_6_0_3.js</script></action>
    </reference>
  </adminhtml>
</layout>

app\code\local\Alphacard\Adminprototypeversion\etc\config.xml

<config>
    <modules>
        <Alphacard_Adminprototypeversion>
            <version>0.1.0</version>
        </Alphacard_Adminprototypeversion>
    </modules>
        <adminhtml>
          <layout>
            <updates>
              <Adminprototypeversion>
                <file>adminprototypeversion.xml</file>
              </Adminprototypeversion>
            </updates>
          </layout>
        </adminhtml>
</config>

app\etc\modules\Alphacard_Adminprototypeversion.xml

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <Alphacard_Adminprototypeversion>
            <active>true</active>`enter code here`
            <codePool>local</codePool>
        </Alphacard_Adminprototypeversion>
    </modules>
</config>

【问题讨论】:

    标签: magento prototype adminhtml


    【解决方案1】:

    在您的应用\design\adminhtml\default\default\layout\adminprototypeversion.xml 中

    您应该能够将&lt;adminhtml&gt; 节点重命名为&lt;default&gt;

    Magento 已经知道它是用于“adminhtml”的,因为模块中的 config.xml 布局更新是在“adminhtml”区域中声明的。

    【讨论】:

      猜你喜欢
      • 2015-09-24
      • 2015-08-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多