php - Magento 管理菜单 block 未显示在配置选项卡中?

标签 php xml magento magento-1.7

我只是 magento 的新手扩展。我想在 magento version 1.7.0.2 中创建一个名为 storeinfo 的新模块。为此,我的 app/local 文件夹结构如下

magento directory
  app
    code
      community
      core
      local---
            |--- New(foldername)--
                  |---Storeinfo(foldername)--
                        |-Block
                          controllers
                          etc
                          Helper
                          sql

位于magentodirectory/app/etc内的New_Storeinfo.xml的代码是这样的

 <?xml version="1.0"?>
<config>
  <modules>
    <New_Storeinfo>
      <active>true</active>
      <codePool>local</codePool>
    </New_Storeinfo>
  </modules>
</config>

现在目录magentodirectory/app/code/local/New/Storeinfo/etc/config.xml是这样的

<?xml version="1.0"?>
<config>
  <modules>
    <New_Storeinfo>
      <version>0.1.1</version>
    </New_Storeinfo>
  </modules>

  <frontend>
    <routers>
      <storeinfo>
        <use>standard</use>
        <args>
          <module>New_Storeinfo</module>
          <frontName>storeinfo</frontName>
        </args>
      </storeinfo>
    </routers>
    <layout>
      <updates>
        <storeinfo>
          <file>newstoreinfo.xml</file>
        </storeinfo>
      </updates>
    </layout>
  </frontend>

  <adminhtml>
    <acl>
      <resources>
        <all>
          <title>Allow Everything</title>
        </all>
        <admin>
          <children>
            <system>
              <children>
                <config>
                  <children>
                    <storeinfo>
                      <title>Store Map</title>
                    </storeinfo>
                  </children>
                </config>
              </children>
            </system>
          </children>
        </admin>
      </resources>
    </acl>
  </adminhtml>

  <global>
        <models>
            <storeinfo>
                <class>New_Storeinfo_Model</class>
        <resourceModel>storeinfo_mysql4</resourceModel>
            </storeinfo>
        </models>
    <resources>
            <storeinfo_setup>
                <setup>
                    <module>New_Storeinfo</module>
                </setup>
                <connection>
                    <use>core_setup</use>
                </connection>
            </storeinfo_setup>
            <storeinfo_write>
                <connection>
                  <use>core_write</use>
                </connection>
            </storeinfo_write>
            <storeinfo_read>
               <connection>
                <use>core_read</use>
              </connection>
            </storeinfo_read>
        </resources>
    <blocks>
            <storeinfo><class>New_Storeinfo_Block</class></storeinfo>
        </blocks>
    <helpers>
            <storeinfo>
                <class>New_Storeinfo_Helper</class>
            </storeinfo>
        </helpers>
    </global>
  <default>
        <storeinfo>
      <address>
        <enabled>1</enabled>
        <title>Our Store Address</title>
        <address>Replace this with Your Address with or without HTML code here....</address>
      </address>
      <storeinfo>
        <enabled>1</enabled>
        <title>Our Location Map</title>
        <map_location>Paste Map HTML code here...</map_location>
      </storeinfo>
    </storeinfo>
    </default>
</config>

现在对于目录magentodirectory/app/code/local/New/Storeinfo/etc/system.xml我的代码是这样的

<?xml version="1.0"?>
<config>
    <tabs>
        <storeinfo translate="label" module="storeinfo">
            <label>Store Map &amp; Address</label>
            <sort_order>132</sort_order>
        </storeinfo>
    </tabs>
    <sections>
        <storeinfo translate="label" module="storeinfo">
            <label>Map &amp; Address Info.</label>
            <tab>storeinfo</tab>
            <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>
            <groups>
                <storeinfo translate="label">
                    <label>Settings</label>
                    <comment><![CDATA[
                        <p>
                            <div>Add Store info:</div>
                        </p>
                    ]]></comment>
                    <frontend_type>text</frontend_type>
                    <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>
                    <fields>
                        <enabled translate="label">
                            <label>Enabled</label>
                            <frontend_type>select</frontend_type>
                            <source_model>adminhtml/system_config_source_yesno</source_model>
                            <sort_order>0</sort_order>
                            <show_in_default>1</show_in_default>
                            <show_in_website>1</show_in_website>
                            <show_in_store>1</show_in_store>
                        </enabled>
                        <title translate="label">
                            <label>Title</label>
                            <frontend_type>text</frontend_type>
                            <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>
                        </title>
                        <map_location translate="label">
                            <label>Location Map HTML code</label>
                            <frontend_type>textarea</frontend_type>
                            <sort_order>3</sort_order>
                            <show_in_default>1</show_in_default>
                            <show_in_website>1</show_in_website>
                            <show_in_store>1</show_in_store>
                            <comment><![CDATA[Collect you store map html code from any of the maps code provides like <strong>Google, Yahoo..</strong>]]></comment>
                        </map_location>
                    </fields>
                </storeinfo>
                <address translate="label">
                    <label>Address</label>
                    <comment><![CDATA[
                        <p>
                            <div>Add Store Address to your Magento Store:</div>
                        </p>
                    ]]></comment>
                    <frontend_type>text</frontend_type>
                    <sort_order>2</sort_order>
                    <show_in_default>1</show_in_default>
                    <show_in_website>1</show_in_website>
                    <show_in_store>1</show_in_store>
                    <fields>
                        <enabled translate="label">
                            <label>Enabled</label>
                            <frontend_type>select</frontend_type>
                            <source_model>adminhtml/system_config_source_yesno</source_model>
                            <sort_order>0</sort_order>
                            <show_in_default>1</show_in_default>
                            <show_in_website>1</show_in_website>
                            <show_in_store>1</show_in_store>
                        </enabled>
                        <title translate="label">
                            <label>Title</label>
                            <frontend_type>text</frontend_type>
                            <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>
                        </title>
                        <address translate="label">
                            <label>Address</label>
                            <frontend_type>textarea</frontend_type>
                            <sort_order>2</sort_order>
                            <show_in_default>1</show_in_default>
                            <show_in_website>1</show_in_website>
                            <show_in_store>1</show_in_store>
                            <comment>Put you store address with or without HTML code</comment>
                        </address>
                    </fields>
                </address>
            </groups>
        </storeinfo>
    </sections>
</config>

但是在所有代码之后,Storeinfo 的菜单没有显示在 magento 的管理配置选项卡中。那么有人可以告诉我这里有什么问题吗?任何帮助和建议都将非常感激。谢谢...

最佳答案

该问题已在 magento.stackexchange.com 上得到解答以及其他详细信息。
问题出在声明 xml 文件中。标签<codepool>应该是<codePool> - 大写P .

关于php - Magento 管理菜单 block 未显示在配置选项卡中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18097525/

相关文章:

php - 无法打开流 : HTTP wrapper does not support writeable connections in Wp-Content(0755)

php - 如何检索和插入ImageId?

xml - XLINQ : Remove certain XElements from a xml file which are saved in a LIst<XElement>

javascript - 从 jQuery XML 对象到字符串的转换引发安全错误

magento - Magento 中的高级导出配置文件

php - Magento 调度自定义事件不起作用

php - 将下拉列表中显示的数据从一个表保存到另一个表

php - 图片上传到 SSL 文件夹,状态代码 200,标题 {connection = closed}

java - 实体的 jaxb XML Marshall 中的 dbId ="0"

magento - Adsense 被注入(inject)我的网站