Php magento 1.9.1.0中无法识别本地自定义模块
我在code/localcodepool文件夹中为magento自定义列布局、magento自定义价格和magento自定义文件扩展名(该扩展名应允许任何视频文件)创建了三个不同的模块 我遵循代码/核心代码池中每个模块的文件夹结构。但是,这些模块无法识别 为了测试我的代码是否正确,我将magento自定义列layout config.xml代码粘贴到app/code/core/Mage/Page/etc以更新它,它可以正常工作 问题: 我的代码如何在代码/本地代码池中工作 这是我的工作magento自定义列布局config.xml文件的一部分Php magento 1.9.1.0中无法识别本地自定义模块,php,html,xml,magento,content-management-system,Php,Html,Xml,Magento,Content Management System,我在code/localcodepool文件夹中为magento自定义列布局、magento自定义价格和magento自定义文件扩展名(该扩展名应允许任何视频文件)创建了三个不同的模块 我遵循代码/核心代码池中每个模块的文件夹结构。但是,这些模块无法识别 为了测试我的代码是否正确,我将magento自定义列layout config.xml代码粘贴到app/code/core/Mage/Page/etc以更新它,它可以正常工作 问题: 我的代码如何在代码/本地代码池中工作 这是我的工作magen
<layouts>
<empty module="page" translate="label">
<label>Empty</label>
<template>page/empty.phtml</template>
<layout_handle>page_empty</layout_handle>
</empty>
<one_column module="page" translate="label">
<label>1 column</label>
<template>page/1column.phtml</template>
<layout_handle>page_one_column</layout_handle>
<is_default>1</is_default>
</one_column>
<full_column module="page" translate="label">
<label>Full 1 column</label>
<template>page/full1column.phtml</template>
<layout_handle>page_one_column_full</layout_handle>
<is_default>1</is_default>
</full_column>
<two_columns_left module="page" translate="label">
<label>2 columns with left bar</label>
<template>page/2columns-left.phtml</template>
<layout_handle>page_two_columns_left</layout_handle>
</two_columns_left>
<two_columns_right module="page" translate="label">
<label>2 columns with right bar</label>
<template>page/2columns-right.phtml</template>
<layout_handle>page_two_columns_right</layout_handle>
</two_columns_right>
<three_columns module="page" translate="label">
<label>3 columns</label>
<template>page/3columns.phtml</template>
<layout_handle>page_three_columns</layout_handle>
</three_columns>
</layouts>
空的
page/empty.phtml
页面为空
1列
第/1页column.phtml
第1页第1列
1.
全1列
page/full1column.phtml
第1页第1列已满
1.
带左栏的2列
第页/2列-left.phtml
第\页两列\左
带右栏的2列
第页/2列-right.phtml
第\页两列\右侧
3列
第/3页columns.phtml
第三页共三列
谢谢 Config.xml只是模块的配置文件,不用于(直接)布局更新。为此,您必须为每个模块创建一个config.xml文件,并在该文件中,通过xml节点“更新”创建xml指令,即向magento发送“这是此模块布局文件的路径”:
。。。
...
(name_of_layout_file.xml)很抱歉,我已经有一段时间没有发布这个问题了。过去几周我一直在休假,所以我没有时间访问此页面
我已经想出了解决这类问题的办法
开发人员将创建的每个自定义模块都应首先将其注册到app/etc/modules文件夹中
步骤1:我按照app/code/core中的文件夹结构,将其放在app/code/local上。结构类似于app/code/local/Mage/Page/etc/config.xml
步骤2:注册我的新模块。我在app/etc/modules中创建了一个.xml文件,并可以任意命名
步骤3:打开我创建的.xml文件并添加这段代码
<?xml version="1.0"?>
<config>
<modules>
<Mage_Page><!-- <Mage_Page> tag came from two folders. Mage is my namespace from app/code/local/Mage and Page is my module name from app/code/local/Mage/Page. -->
<active>true</active>
<codePool>local</codePool>
</Mage_Page>
</modules>
</config>
真的
地方的
步骤4:保存您创建/更新的所有文件
第5步:我刷新管理页面,检查我的工作是否正常,是否正常
由于缺乏开发magento的知识和经验,这花了我一段时间。但是谢谢你的帮助
谢谢 IIRC app/code/core/Mage/Page/etc/config.xml有特殊的处理规则,所以您不能以这种方式进行测试。在任何情况下,您都不应该更改这些核心文件夹中的数据,即使是为了测试。因此,我认为它只对MaGeto问题做了一个很差的描述,对解决您的问题没有帮助。您不考虑“代码> ETC/Basic?XML/CODE >用于布局更新而不是<代码> ECT/CONFIG.XML/CODE?相关的:
<?xml version="1.0"?>
<config>
<modules>
<Mage_Page><!-- <Mage_Page> tag came from two folders. Mage is my namespace from app/code/local/Mage and Page is my module name from app/code/local/Mage/Page. -->
<active>true</active>
<codePool>local</codePool>
</Mage_Page>
</modules>
</config>