magento XML配置文件的一些笔记及说明(更新中)

system.xml


<config>
    <tabs><!-- 注册一个标签 在后台config左边的分类设置栏 -->
        <someoption translate="label" module="extraconfig"><!-- someoption节点的唯一ID可以随便取,保持唯一性即可,module代表这个节点属于哪个模块的 -->
            <label>Some Options</label><!-- 节点所要显示出来的名字 -->
            <sort_order>1</sort_order><!-- 标签显示的位置 -->
        </someoption>
    </tabs>
    <sections><!-- 标签的选项 -->
        <imagescroll translate="label" module="extraconfig"><!-- imagescroll选项的唯一标识,可以随便取,保持唯一性即可 -->
            <label>ImageScroll Setting</label><!-- 选项名 -->
            <tab>someoption</tab><!-- 所属标签 -->
            <frontend_type>text</frontend_type>
            <sort_order>40</sort_order>
            <show_in_default>1</show_in_default><!-- 是否显示 -->
            <show_in_website>1</show_in_website><!-- 是否显示 -->
            <show_in_store>1</show_in_store><!-- 是否显示 -->
            <groups><!-- 定义右边的一些选项及设置 -->
                <imagescrolloption translate="label"><!-- imagescrolloption随便取,保持唯一 -->
                    <label>Uploade Images</label>
                    <frontend_type>text</frontend_type>
                    <sort_order>100</sort_order>
                    <show_in_default>1</show_in_default>
                    <show_in_website>1</show_in_website>
                    <show_in_store>1</show_in_store>
                    <fields><!-- 一些设置 -->
                        <imagesupload0>
                            <label>Image One:</label>
                            <!--
                                frontend_type可以使用以下的选项:
                                allowspecific
                                export
                                image
                                import
                                label
                                multiselect
                                obscure
                                password
                                select
                                text
                                textarea
                                time
                            -->
                            <frontend_type>image</frontend_type><!-- 选项的类型 -->
                            <backend_model>adminhtml/system_config_backend_image</backend_model><!-- 上载文件所使用的系统模块 -->
                            <upload_dir config="system/filesystem/media" scope_info="1">ebay/scroll</upload_dir><!-- 上载到的位置 -->
                            <base_url type="media" scope_info="1">ebay/scroll</base_url><!-- <img标签中src所使用的路径 -->
                            <sort_order>1</sort_order>
                            <show_in_default>1</show_in_default>
                            <show_in_website>1</show_in_website>
                            <show_in_store>1</show_in_store>
                        </imagesupload0>
                    </fields>
                </imagescrolloption>
            </groups>
        </imagescroll>
    </sections>
</config>

config.xml


<?xml version="1.0"?>
<config>
    <modules><!-- 代表模块 -->
        <SomeOption_ExtraConfig><!-- 包_模块 -->
            <version>1.0.0</version><!-- 版本号 编写升级包时需要用到 -->
        </SomeOption_ExtraConfig>
    </modules>
    <global>
        <helpers><!-- 定义帮助类 -->
            <extraconfig><!-- 模块名注意一般都使用小写 -->
                <class>SomeOption_ExtraConfig_Helper</class><!-- 帮助类中类名的前缀,后台建立新的标签时必须的 -->
            </extraconfig>
        </helpers>
        <blocks><!-- 定义Block类 -->
            <extraconfig><!-- 模块名注意一般都使用小写 -->
                <class>SomeOption_ExtraConfig_Block</class><!-- Block类的前缀 -->
            </extraconfig>
        </blocks>
    </global>
</config>


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值