0

add config file it display admin side as sub menu name (New Address)

<admin>
     <routers>
         <test>
            <use>admin</use>
            <args>
               <module>Pfay_Test</module>
               <frontName>admintest</frontName>
            </args>
         </test>
      </routers>
 </admin>
 <adminhtml>
   <layout>
      <updates>
          <test>
              <file>test.xml</file>
           </test>
      </updates>
   </layout>
   <menu>
      <test translate="title" module="adminhtml">
         <title>My Pugins</title>
         <sort_order>100</sort_order>
         <children>
             <set_time>
                   <title>Adress book</title>
                   <action>admintest/adminhtml_index</action>
              </set_time>
              <submenu translate="title" module="adminhtml">
                                        <title>New Address</title>
                                        <action>admintest/adminhtml_test/</action>
                                    </submenu>
          </children>
       </test>
    </menu>
</adminhtml>

Create controller file it's name is Test

class Pfay_Test_Adminhtml_TestController extends Mage_Adminhtml_Controller_Action
{
  public function indexAction()
  {

          $this->loadLayout();
          $this->renderLayout();
  }
}

adding my layout file test.xml

<test_adminhtml_index_index_test>
     <reference name="content">
            <block type="test/monblock"  name="afficher_monbloc"
                  template="test/test2.phtml" />
                  <block type="test/adminhtml_grid" name="test" />
      </reference>
   </test_adminhtml_index_index_test>

Can You Please solve this?

3
  • <children> <index module="adminhtml" translate="title"> <title>Adress book</title> <sort_order>1</sort_order> <action>admintest/adminhtml_index</action> </index> <list module="adminhtml" translate="title"> <title>Test book</title> <sort_order>2</sort_order> <action>admintest/adminhtml_test</action> </list> </children>
    – coder
    Aug 5, 2014 at 6:08
  • <test_adminhtml_test_index> <reference name="content"> <block type="test/monblock" name="afficher_monbloc" template="test/test2.phtml" /> <block type="test/adminhtml_Testgrid" name="test" /> </reference> </test_adminhtml_test_index>
    – coder
    Aug 5, 2014 at 6:13
  • I will add in config file in first comment. and second comment i am add test.xml file in admin layout. issue is very small </test_adminhtml_index_index_test> instaed of </test_adminhtml_test_index> call the file
    – coder
    Aug 5, 2014 at 6:14

1 Answer 1

0

If your admin url is admintest/adminhtml_index then the layout handle should be <admintest_adminhtml_index_index> not <test_adminhtml_index_index_test>.
Same goes for admintest/adminhtml_test. The layout handles should be <admintest_adminhtml_test_index>

the layout handle is built like this namespace_controller_action.
if the controller name looks like this controller_name then it should be namespace_controller_name_action.
If the action is missing then it defaults to index.

5
  • It's true. I was finding a solution In My last comment. Thank you very Much For Answer Me. You say Me it's also right.
    – coder
    Aug 6, 2014 at 5:56
  • @JaydipsinhParmar. When you ask a question and find a solution later, don't post is as a comment. Post it as an answer and mark it as accepted. This way the question is marked as answered and may help future readers.
    – Marius
    Aug 6, 2014 at 6:11
  • Is It's Ok, Now?
    – coder
    Aug 6, 2014 at 6:15
  • @JaydipsinhParmar. I was saying that you could have added an answer yourself and mark your answer as accepted. Not that you have to mark my answer. :)
    – Marius
    Aug 6, 2014 at 6:21
  • Hello Marius, It's Another Question Plaese check it My Controller Question
    – coder
    Aug 6, 2014 at 6:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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