1

I created Simple Hello world Module But it's not Display Front End

Also I can't Understand in test.xml can you please any one explain it

app/code/local/Manoj/Test/etc/config.xml

<?xml version="1.0"?>
    <config>
        <modules>
            <Manoj_Test>
                <version>0.1.0</version>
            </Manoj_Test>
        </modules>
        <frontend>
            <routers>
                <test>
                    <use>standard</use>
                    <args>
                        <module>Manoj_Test</module>
                        <frontName>test</frontName>
                    </args>
                </test>
            </routers>
            <layout>
                <updates>
                    <test>
                        <file>test.xml</file>
                    </test>
                </updates>
            </layout>
        </frontend>
        <global>
            <blocks>
                <test>
                    <class>Manoj_Test_Block</class>
                </test>
            </blocks>
            <helpers>
                <test>
                    <class>Manoj_Test_Helper</class>
                </test>
            </helpers>
        </global>


    </config>

app/design/frontend/default/Manoj/layout/test.xml

<?xml version="1.0"?>
    <layout version = "1.0"?>
        <test_index_index>
            <reference name="content">
                <block type="test/test" name="test" template="test/test.phtml"/>                                
            </reference>
        </test_index_index>
    </layout>   

app/code/local/Manoj/Test/Block/test.php

<?php 


class Manoj_Test_Block_Test extends Mage_Core_Block_Template{

        public function getContent(){

            return "My First Module";
        }

}

app/design/frontend/default/Manoj/template/test/test.phtml

<?php
    echo $this->getContent();
?>

app/code/local/Manoj/Test/controllers/IndexController.php

<?php 

class Manoj_Test_IndexController extends Mage_Core_Controller_Front_Action{


    public function indexAction()
    {
        $this->loadLayout();  //This function read all layout files and loads them in memory
        $this->renderLayout(); //This function processes and displays all layout phtml and php files.
    }

}

Manoj_Test.xml

<?xml version="1.0"?>
    <config>
        <modules>
            <Manoj_Test>
                <active>true</active>
                <codePool>local</codePool>
            </Manoj_Test>
        </modules>
    </config>
16
  • Do you have a controller declared ? Commented Feb 25, 2016 at 11:23
  • Please post your controller too. Commented Feb 25, 2016 at 11:23
  • Check my updated question
    – user31402
    Commented Feb 25, 2016 at 11:24
  • add the files path too Commented Feb 25, 2016 at 11:27
  • 1
    app/code/local/Manoj/Test/Block/Test.php the file name must be capital as added in class Manoj_Test_Block_Test also check the error log for errors. and make sure your cache is diabled Commented Feb 25, 2016 at 11:33

1 Answer 1

0

after testing and changing in both file it start working

config.xml

<?xml version="1.0"?>
<config>
  <modules>
    <Manoj_Test>
      <version>0.1.0</version>
    </Manoj_Test>
  </modules>
  <frontend>
    <routers>
      <test>
        <use>standard</use>
          <args>
            <module>Manoj_Test</module>
            <frontName>test</frontName>
          </args>
      </test>
    </routers>
        <layout>
          <updates>
            <test>
              <file>test.xml</file>
            </test>
          </updates>
        </layout>
  </frontend>
  <global>
    <helpers>
      <test>
        <class>Manoj_Test_Helper</class>
      </test>
    </helpers>
    <blocks>
      <test>
        <class>Manoj_Test_Block</class>
      </test>
    </blocks>
  </global>
</config> 

test.xml

  <?xml version="1.0"?>   
<layout version="0.1.0">   
  <test_index_index>   
    <reference name="root">   
      <action method="setTemplate"><template>page/1column.phtml</template></action>   
    </reference>   
    <reference name="content">   
      <block type="test/test" name="test" template="test/test.phtml"/>   
    </reference>   
  </test_index_index>   
</layout>
5
  • Thanks @Qaisar Satti can you please explain this <test_index_index>
    – user31402
    Commented Feb 29, 2016 at 4:57
  • test is your module name and index is your controller name and last index is your IndexController Action method. Commented Feb 29, 2016 at 5:01
  • Hey You know how to filer recent customer display first
    – user31402
    Commented Feb 29, 2016 at 6:50
  • you can apply sort by id desc the recent will display first $collection = Mage::getModel('customer/customer')->getCollection() ->addAttributeToSelect('firstname') ->addAttributeToSelect('lastname') ->addAttributeToSelect('email')->setOrder('entity_id' , 'desc'); Commented Feb 29, 2016 at 7:27
  • But it's seller can you please check this magento.stackexchange.com/questions/103747/…
    – user31402
    Commented Feb 29, 2016 at 7:28

Your Answer

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