Вкладка "Конфигурация системы" Не отображает CE 1.8
Я пытаюсь добавить простую вкладку в конфигурацию системы в Magento CE 1.8.0.0. Это вообще не отображается в моем коде, как показано ниже:
Файл: app/code/community/Test/Module/etc/adminhtml.xml
<?xml version="1.0"?>
<config>
<acl>
<resources>
<all>
<title>Allow Everything</title>
</all>
<admin>
<children>
<system>
<children>
<config>
<children>
<test_module translate="title" module="test_module">
<title>Test Tabs Section</title>
<sort_order>999</sort_order>
</test_module>
</children>
</config>
</children>
</system>
</children>
</admin>
</resources>
</acl>
</config>
Файл: app/code/community/Test/Module/etc/config.xml
<?xml version="1.0"?>
<config>
<modules>
<Test_Module>
<version>0.1.0</version>
</Test_Module>
</modules>
<global>
<helpers>
<test_module>
<class>Test_Module_Helper</class>
</test_module>
</helpers>
</global>
</config>
Файл: app/code/community/Test/Module/etc/system.xml
<?xml version="1.0"?>
<config>
<tabs>
<test_module translate="label" module="test_module">
<label>Test Module</label>
<sort_order>999</sort_order>
</test_module>
</tabs>
</config>
Файл: app/code/community/Test/Module/Helper/Data.php
<?php
class Test_Module_Helper_Data extends Mage_Core_Helper_Data
{}
Файл: app/etc/modules/Test_Module.xml
<?xml version="1.0"?>
<config>
<modules>
<Test_Module>
<active>true</active>
<codePool>community</codePool>
<depends>
<Mage_Adminhtml />
</depends>
</Test_Module>
</modules>
</config>
Я ожидаю пустую вкладку в разделе конфигурации системы администратора, но ничего не отображается вообще. Я очистил кэш и несколько раз перерегистрировался. Что я делаю не так? Спасибо!
1
1 answers
Вкладка не отображается, если в ней нет разделов (скорее всего).
Добавьте раздел, в котором есть хотя бы группа и поле.
[ РЕДАКТИРОВАТЬ]
Вот мой system.xml
, который сработал:
<?xml version="1.0"?>
<config>
<tabs>
<test_module translate="label" module="test_module">
<label>Test Module</label>
<sort_order>999</sort_order>
</test_module>
</tabs>
<sections>
<test_module translate="label" module="test_module">
<label>Test</label>
<tab>test_module</tab>
<frontend_type>text</frontend_type>
<sort_order>400</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<groups>
<settings translate="label">
<label>Settings</label>
<frontend_type>text</frontend_type>
<sort_order>10</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>10</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</enabled>
</fields>
</settings>
</groups>
</test_module>
</sections>
</config>
2
Author: Marius, 2013-10-29 11:32:27