0

Hi i see this question a few times here but i can't solve my error, i got well until the blank page in my admin custom module, I follow this tutorial. So can somebody tell me the right direction i got almost a week trying to solve this.

My files are:

  • app\code\local\meteorify\observerexample\controllers\observerexamplecontroller.php
  • app\code\local\Meteorify\Observerexample\etc\adminhtml.xml
  • app\code\local\meteorify\observerexample\etc\config.xml
  • app\code\local\Meteorify\Observerexample\Helper\Data.php (empty)
  • app\etc\modules\Meteorify_Observerexample.xml
  • app\design\adminhtml\default\default\layout\icommkt_email.xml
  • app\design\adminhtml\default\default\template\observerexample\index.phtml

The content of the files are:

observerexamplecontroller.php

<?php
     class Meteorify_Observerexample_ObserverexampleController extends  Mage_Adminhtml_Controller_Action
    {
        public function indexAction()
        {
            $this->loadLayout();
            $this->renderLayout();
        }
    }   

adminhtml.xml

<?xml version="1.0" encoding="utf-8" ?>
<config>
  <menu>
    <Meteorify_Observerexample translate="title" module="Meteorify_Observerexample">
      <title>Icommkt</title>
      <sort_order>1</sort_order>
      <children>
        <example>
          <title>Email</title>
          <sort_order>1</sort_order>
          <action>adminhtml/Observerexample/index</action>
        </example>
      </children>
    </Meteorify_Observerexample>
</menu>
  <acl>
    <resources>
      <admin>
        <children>
          <Meteorify_Observerexample translate="title" module="Meteorify_Observerexample">
            <title>Top Level Icommkt Menu Item</title>
            <sort_order>1</sort_order>
            <children>
              <example>
                  <title>Example Menu Item</title>
              </example>
            </children>
          </Meteorify_Observerexample>
        </children>
      </admin>
    </resources>
  </acl>
  <layout>
    <updates>
      <Meteorify_Observerexample>
        <file>Icommkt_Email.xml</file>
      </Meteorify_Observerexample>
    </updates>
  </layout>
</config>

config.xml

<?xml version="1.0" encoding="utf-8"?>
<config>
  <modules>
    <Meteorify_Observerexample>
      <version>0.0.1</version>
    </Meteorify_Observerexample>
  </modules>
  <global>
    <models>
      <meteorifyobserverexample>
        <class>Observerexample_Model</class>
      </meteorifyobserverexample>
    </models>
    <events>
      <customer_register_success>
        <observers>
          <meteorify_observerexample_model_observer>
            <class>Meteorify_Observerexample_Model_Observer</class>
            <method>example</method>
            <type>singleton</type>
          </meteorify_observerexample_model_observer>
        </observers>
      </customer_register_success>
      <checkout_submit_all_after>
        <observers>
          <meteorify_observerexample_model_observer>
            <class>Meteorify_Observerexample_Model_Observer</class>
            <method>example</method>
            <type>singleton</type>
          </meteorify_observerexample_model_observer>
        </observers>
      </checkout_submit_all_after>
    <customer_address_save_after>
        <observers>
            <meteorify_observerexample_model_observer>
                <class>Meteorify_Observerexample_Model_Observer</class>
                <method>onCustomerAddressSaveAfter</method>
                <type>singleton</type>
            </meteorify_observerexample_model_observer>
        </observers>
    </customer_address_save_after>
    </events>
    <helpers>
      <Meteorify_Observerexample>
        <class>Meteorify_Observerexample_Helper</class>
      </Meteorify_Observerexample>
    </helpers>
  </global>
  <admin>
      <routers>
        <adminhtml>
          <args>
            <modules>
              <Meteorify_Observerexample after="Mage_Adminhtml">Meteorify_Observerexample</Meteorify_Observerexample>       
          </modules>
          </args>
        </adminhtml>
      </routers>
    </admin>
</config>

Meteorify_Observerexample.xml

<?xml version="1.0" encoding="utf-8"?>
<config>
    <modules>
        <Meteorify_Observerexample>
            <codePool>local</codePool>
            <active>true</active>
        </Meteorify_Observerexample>
    </modules>
</config>

icommkt_email.xml

<layout version="0.1.0">
  <adminhtml_meteorify_observerexample_observerexample_index>
    <update handle="admin_index"/>
    <reference name="content">
      <block type="core/template" name="Meteorify_Observerexample" template="observerexample/index.phtml" />
    </reference>
  </adminhtml_meteorify_observerexample_observerexample_index>
</layout>

Here index.phtml is a simple Hello world, but i got only a blank page with no errors. So can anyone tell me what are the errors with Magento here?

Update 1

in the image below is how looks after try the method 2 Method 2

  • Is that a blank white screen, or a blank page with the admin chrome? – Alan Storm Sep 2 '16 at 18:33
  • is the blank page with the admin chrome. – RokumDev Sep 2 '16 at 23:07
0

I think you have problem with your handler in icommkt_email.xml file.

Method 1:

You can print handler in your via your controller by print_r($this->getLayout()->getUpdate()->getHandles()) in array[3] you get handler just replace it with
adminhtml_meteorify_observerexample_observerexample_index and try again

method 2:

print core/template directly adding in your controller indexAction by adding below code

<?php echo $this->getLayout()->createBlock('core/template')->setTemplate('observerexample/index.phtml')->toHtml() ?>
  • The method one give me the right handler something like adminhtml_observerexample_index but the change doesn't show the .phtml. In the case for the method 2 show the Hello World before the magento admin chrome. I will upload an image to show how looks in the question. – RokumDev Sep 2 '16 at 23:15
  • Ok may be the cache issue flush magento cache and try again and if answer help you then mark as accepted – Murtuza Zabuawala Sep 3 '16 at 4:43
  • have seen the image in my question? – RokumDev Sep 3 '16 at 14:27
0

It looks like your layout update XML isn't loading. You have a icommkt_email.xml file on disk, but your configuration is pointing to Icommkt_Email.xml

      <layout>
        <updates>
          <Meteorify_Observerexample>
            <file>Icommkt_Email.xml</file>
          </Meteorify_Observerexample>
        </updates>
      </layout>

The best way to debug this is to turn on developer mode and introduce a deliberate XML structure error into icommkt_email.xml. Once Magento trips over that XML error you'll know Magento is trying to load your file, and you can move on to the next step of your program and/or debugging.

  • Ok, I make that test and show the Magento error page, so this xml is loading, what can be the next step for debug this? thanks for your help. – RokumDev Sep 3 '16 at 14:43

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.