1

I need to have 2 submenus in one menu in System menu.

It shows for me 2 submenus, but clicking on it just redirects a browser to the front page.

This is my config.xml part:

<admin>
    <routers>
        <sphinxsearch>
            <use>admin</use>
            <args>
                <module>AD_SphinxSearch_Adminhtml</module>
                <frontName>sphinxsearch</frontName>
            </args>
        </sphinxsearch>
    </routers>
</admin>

This is my adminhtml.xml part:

<menu>
    <system>
        <children>
            <sphinxsearch module="sphinxsearch">
                <title>Sphinx Search</title>
                <sort_order>9999</sort_order>
                <depends>
                    <module>AD_SphinxSearch</module>
                </depends>
                <children>
                    <wordforms module="sphinxsearch">
                        <title>Word Forms</title>
                        <sort_order>1</sort_order>
                        <action>sphinxsearch/wordforms</action>
                    </wordforms>
                    <stopwords module="sphinxsearch">
                        <title>Stop Words</title>
                        <sort_order>2</sort_order>
                        <action>sphinxsearch/stopwords</action>
                    </stopwords>
                </children>
            </sphinxsearch>
        </children>
    </system>
</menu>

And this is a structure of controllers:

AD

  • SphinxSearch

    • controllers
        • Adminhtml
          • StopwordsController.php
          • WordformsController.php

Each class (AD_SphinxSearch_Adminhtml_StopwordsController, AD_SphinxSearch_Adminhtml_WordformsController) extends Mage_Adminhtml_Controller_Action and has indexAction methods.

What am I doing wrong?

1

Sergi,In config.xml file module is not right, it should be AD_SphinxSearch from AD_SphinxSearch_Adminhtml

<admin>
     <routers>
        <adminhtml>
            <args>
                <modules>
                    <ad_sphinxsearch before="Mage_Adminhtml">AD_SphinxSearch_Adminhtml</ad_sphinxsearch>
                </modules>
            </args>
        </adminhtml>
    </routers>
</admin> 

And in adminhtml.xml file there are lot of issue. syntax is not proper

  <adminhtml>
    <!-- define menu -->
    <menu>
      <sphinxsearch module="sphinxsearch">
        <title>SphinxSearch</title>
        <sort_order>100</sort_order>
        <children>
          <wordforms module="sphinxsearch">
            <title>wordforms Page Title</title>
            <sort_order>0</sort_order>
            <action>adminhtml/stopwords</action>
          </wordforms>
          <stopwords module="sphinxsearch">
            <title>stopwords Page Title</title>
            <sort_order>0</sort_order>
            <action>adminhtml/stopwords</action>
          </stopwords>
        </children>
      </sphinxsearch>
    </menu>
    <acl>
      <resources>
        <all>
          <title>Allow Everything</title>
        </all>
        <admin>
          <children>
            <sphinxsearch translate="title" module="sphinxsearch">
              <title>SphinxSearch</title>
              <sort_order>1000</sort_order>
              <children>
                <wordforms translate="title">
                <title>Wordforms Page Title</title>
                </wordforms>
                <stopwords translate="title">
                <title>Stopwords Page Title</title>
                </stopwords>

              </children>
            </sphinxsearch>
          </children>
        </admin>
      </resources>
    </acl>
  </adminhtml>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.