我正在尝试为我的自定义模块实现一些配置设置。我已经设法在左侧导航栏中添加了一个选项卡和一个部分。但是当我想要打开一个部分时,我得到一个404错误页面,没有任何进一步的信息。
到目前为止,我已经想尽办法让它工作了..阅读博客,示例等,但我找不到错误。也许你们谁能给我解释一下我做错了什么。
我的adminhtml.xml
<?xml version="1.0" ?>
<config>
<resources>
<admin>
<children>
<system>
<children>
<config>
<children>
<tempest_section translate="title" module="Tempest">
<title>Tempest</title>
</tempest_section>
</children>
</config>
</children>
</system>
</children>
</admin>
</resources>
</config>我的config.xml
<?xml version="1.0"?>
<config>
<modules>
<Polyvision_Tempest>
<version>0.1.0</version>
</Polyvision_Tempest>
</modules>
<global>
<helpers>
<Tempest>
<class>Polyvision_Tempest_Helper</class>
</Tempest>
</helpers>
</global>
<admin>
<routers>
<adminhtml>
<args>
<modules>
<tempest before="Mage_Adminhtml">Polyvision_Tempest_Adminhtml</tempest>
</modules>
</args>
</adminhtml>
</routers>
</admin>
<adminhtml>
<menu>
<menu1 translate="title" module="Tempest">
<title>polyvision</title>
<sort_order>60</sort_order>
<children>
<menuitem1 module="Tempest">
<title>Tempest - Export</title>
<action>adminhtml/tempest_main</action>
</menuitem1>
</children>
</menu1>
</menu>
</adminhtml>
<default>
<tempest>
<settings>
<export_directory>/tmp/</export_directory>
</settings>
</tempest>
</default>
</config>我的system.xml
<?xml version="1.0" ?>
<config>
<tabs>
<polyvision module="Tempest" translate="label">
<label>polyvision</label>
<sort_order>100</sort_order>
</polyvision>
</tabs>
<sections>
<tempest_section module="Tempest" translate="label">
<label>Tempest-Einstellungen</label>
<sort_order>200</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<tab>polyvision</tab>
<groups>
<settings translate="label">
<label>Settings</label>
<comment></comment>
<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>
<export_directory translate="label tooltip comment">
<label>My Custom Field</label>
<comment>Some comment about my field</comment>
<tooltip>Field ToolTip</tooltip>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<frontend_input>text</frontend_input>
<source_model>adminhtml/system_config_text</source_model>
</export_directory>
</fields>
</settings>
</groups>
</tempest_section>
</sections>
嗯,我的模块本身运行起来没有任何问题。只有管理员设置不起作用:/
发布于 2011-06-21 21:29:20
如果它是管理控制台chrome中的404,那么您的问题是缺少ACL角色。阅读this article on how to set one up。(自链接)
此外,在设置ACL角色后,您需要清除Magento会话。Magento缓存会话中的特定角色,新会话不会自动添加到具有超级用户角色的用户的缓存中。
发布于 2011-06-21 17:16:29
嗨,我想config.xml中的动作标签有问题。
<action>adminhtml/tempest_main</action>如果我没记错的话,这是指app/code/core/Mage/Adminhtml中的adminhtml模块。
你的模块的名字是什么?在你的控制器文件夹里有什么?
我认为动作的第一步应该是你的控制器的名称,然后是你的管理控制器和动作的路径
action标签的构建方式如下。
<action>matrixrate/adminhtml_index/index</action>
|--module--|--controller---|-action-|HTH
发布于 2019-05-08 13:31:26
在您的config.xml中授予acl权限。
<adminhtml>
<acl>
<resources>
<all>
<title>Allow Everything</title>
</all>
<admin>
<children>
<system>
<children>
<config>
<children>
<tab_name>
<title>Module - All</title>
</tab_name>
</children>
</config>
</children>
</system>
</children>
</admin>
</resources>
</acl>
</adminhtml>刷新缓存,注销,然后再次登录。
https://stackoverflow.com/questions/6422883
复制相似问题