【问题标题】:Magento Module for new CMS layout, but in version 1.7.0.2用于新 CMS 布局的 Magento 模块,但版本为 1.7.0.2
【发布时间】:2012-08-03 19:36:08
【问题描述】:

我正在尝试为 Magento 中的 CMS 页面创建一个新的布局选项。我已经按照instructions here on the Magento wiki 创建了一个模块,但它不起作用。当我对实际的核心 config.xml 文件进行相同的添加时,它可以正常工作,但不能作为自定义模块。根据一些研究,这似乎可以在 Magento 1.6 中使用,但在 1.7 中不起作用,我试图找出原因。我有以下内容:

app/etc/modules/Fruit_Banana.xml

<?xml version="1.0"?>
<config>
  <modules>
    <Fruit_Banana>
      <active>true</active>
      <codePool>local</codePool>
      <depends>
        <Mage_Page />
      </depends>
    </Fruit_Banana>
  </modules>
</config>

app/code/local/Fruit/Banana/etc/config.xml

<?xml version="1.0"?>
<config>
  <modules>
    <Fruit_Banana>
      <version>0.1.0</version>
    </Fruit_Banana>
  </modules>
  <global>
    <page>
      <layouts>
        <homepage_middle translate="label">
          <label>Homepage</label>
          <template>page/homepage.phtml</template>
          <layout_handle>homepage_one</layout_handle>
        </homepage_middle>
        <!-- add more layouts here -->
      </layouts>
    </page>
  </global>
</config>

任何想法为什么它似乎不能作为一个模块工作?我使用的是 1.7.0.2 版

【问题讨论】:

  • Magento 是否将您的模块识别为已安装?
  • 它确实在“管理”>“配置”>“高级”>“高级”页面中列出了启用的模块。是这个意思吗?
  • 是的,我就是这个意思。您的问题似乎 Magento 没有看到该模块(这最终是真的)对于它的价值,我的模块列表模块(magentocommerce.com/magento-connect/module-list.html)执行类似的功能,但也会检查丢失的 etc/config.xml 文件和代码池冲突。

标签: magento


【解决方案1】:

local 模块应该在code 目录中

app/code/local/Fruit/Banana/etc/config.xml

而不是你提到的core目录

app/code/core/local/Fruit/Banana/etc/config.xml

【讨论】:

【解决方案2】:

看来我搞砸了!它实际上在 1.7 中有效,我的问题是我将 config.xml 的文件名拼写为 confix.xml

一旦我进行了调整,自定义布局就会立即弹出!感谢那些插话的人。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-12-15
    • 2014-08-29
    • 2012-03-08
    • 1970-01-01
    • 2014-04-27
    • 1970-01-01
    • 1970-01-01
    • 2015-05-09
    相关资源
    最近更新 更多