0

This is the content of my custom module, config.xml file:

<adminhtml>
        <layout>
            <updates>
                <mymodule>
                    <file>homepage.xml</file>
                </mymodule>
            </updates>
        </layout>
    </adminhtml>

this is the content of the layout/homepage.xml file from

<?xml version="1.0"?>
<layout>
    <adminhtml_manage_index>
        <reference name="content">
            <block type="mynamespace_mymodule/adminhtml_banner" name="mynamespace_mymodule_banner" />
        </reference>
    </adminhtml_manage_index>
</layout>

This is the content of my controller Mynamespace/Mymodule/controllers/Adminhtml/ManageController.php

class Mynamespace_Mymodule_Adminhtml_ManageController extends Mage_Adminhtml_Controller_Action
{
    public function indexAction()
    {  
        $this->loadLayout();
        $this->_initAction()->renderLayout();
    } 
}

and the content of the Mynamespace/Mymodule/Block/Adminhtml/Banner.php

class Mynamespace_Mymodule_Block_Adminhtml_Banner extends Mage_Adminhtml_Block_Widget_Grid_Container
{
    public function __construct()
    {
        echo 1; exit();
//....
    }
}

My problem is that it doesn't access the block. I put an exit() there . But I cannot get there. Why ? What am I missing ? thx

5
  • Please replace Mynamespace/Mymodule/Block/AdminHtml/Banner.php to and the content of the Mynamespace/Mymodule/Block/Adminhtml/Banner.php
    – Abdul
    Nov 4, 2015 at 12:25
  • Mynamespace/Mymodule/controllers/AdminHtml/ManageController.php to Mynamespace/Mymodule/controllers/Adminhtml/ManageController.php
    – Abdul
    Nov 4, 2015 at 12:25
  • @Abdul I don't understand. Can you give more details! Nov 4, 2015 at 12:31
  • rename folder name "AdminHtml" => "Adminhtml"
    – Abdul
    Nov 4, 2015 at 12:34
  • sorry my mistake, it is Adminhtml not AdminHTML, from the start, I updated my post Nov 4, 2015 at 12:37

1 Answer 1

1

Rename folder name "AdminHtml" => "Adminhtml"

Please replace from

<?xml version="1.0"?>
<layout>
    <adminhtml_manage_index>
        <reference name="content">
            <block type="mynamespace_mymodule/adminhtml_banner" name="mynamespace_mymodule_banner" />
        </reference>
    </adminhtml_manage_index>
</layout>

To

<?xml version="1.0"?>
<layout>
    <mymodule_adminhtml_manage_index>
        <reference name="content">
            <block type="mynamespace_mymodule/adminhtml_banner" name="mynamespace_mymodule_banner" />
        </reference>
    </mymodule_adminhtml_manage_index>
</layout>
3
  • nothing changed I still don't get to echo 1; exit(); . any other idea ? thx Nov 4, 2015 at 12:35
  • can you please vote me and assp my ans?
    – Abdul
    Nov 4, 2015 at 12:39
  • its work. but instead of mymodule, i must write mynamespace. please update your post with my suggestion and I will accept your post as answer. thx Nov 4, 2015 at 12:42

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.