I have created the custom admin module, it showing empty page.

my code is:

//config.xml file


//adminhtml.xml file

<?xml version="1.0"?>
        <web module="web" translate="label">
                <dotnet module="web" translate="label">
                    <title>Dot Net</title>
                <php module="web" translate="label">
                <title>Allow Everything</title>
                        <title>Web Module</title>

//controller file


class Department_Web_Adminhtml_IndexController extends Mage_Adminhtml_Controller_Action
    protected function _initAction()
        $this->loadLayout()->_setActiveMenu('web/set_time')->_addBreadcrumb('Web Manager','Web Manager');
        return $this;

    public function indexAction()

//layout file adminhtml->defalt->Department->layout

<?xml version="1.0"?>
<layout version="0.1.0">
        <reference name="content">
            <block type="web/adminhtml_grid" name="adminhtml_web"></block>

looking for solution?

Thanks in advance.


You haven't provided all information to be able to give the correct answer. To debug, turn on the Magento developer mode (if you haven't done so already) and check the following:

1) Is web.xml being loaded?

To do so, create non-wellformed XML in the file by removing a closing tag and saving. When you reload a admin page you should see a simplexml parse error.
If you don't see the error, check
a) the layout cache is disabled,
b) the web.xml file system path and file name is correct c) the config cache has been refreshed or disabled

2) Is the block file loaded?

Check the var/log/exception.log file to see if there is a "Invalid Block Type" message in there.
If Magento is looking for a block with a class name Mage_Web_Block_Adminhtml_Grid, it means it can't resolve your block class group web/adminhtml_grid.
Add the global/blocks/web/class node to your config.xml file, with the node value Department_Web_Block.

If there is no error record in the exception.log file, add a die(__FILE__) statement outside of your class declaration to your block class. If Magento finds the file and includes it, you should see the file name as the only output when you try to reload the admin page.

3) Is your bock rendering something?

Does your block inherit the correct parent class? Depending on what you want to do it probably is one of

  • Mage_Adminhtml_Block_Widget_Grid_Container
  • Mage_Adminhtml_Block_Widget_Grid
  • Mage_Adminhtml_Block_Template
  • Mage_Adminhtml_Block_Abstract

Check a valid template file is assigned if you are extension one of the first three. If the template file doesn't exist, a page load will generate a message in the file var/log/system.log. If your block only extends the abstract block class, make sure that you implemented the _toHtml() method and that it returns a non-empty string.

The above steps should let you find the reason why Magento isn't showing what you expect.


You have call block in layout xml, but there is missing block file. create a Web.php in block folder and refresh cache.

If this not work print some thing in block file and check you are able to access the block.

Then create grid or add template file.

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.