I am trying to load a custom .phtml template using custom block. But the template isn't loading. I saw similar problems here and tried to figure out a solution, but couldn't find out where the problem is. My controller is working correctly. The url http://localhost/magento/test/index loads view correctly, but without testlayout.phtml contents.

Hers's my code



class Impulse_Test_IndexController extends Mage_Core_Controller_Front_Action {

    public function indexAction() {

    public function testAction() {
        echo "This is test!";


<?xml version="1.0"?>


<?xml version="1.0" encoding="UTF-8"?>
<layout version="0.1.0">
        <reference name="content">
            <block type="impulse_test/testblock" name="testlayout_testblock" output="toHtml" template="test/testlayout.phtml"></block>


class Impulse_Test_Block_Testblock extends Mage_Core_Block_Template {
    public function methodblock() {
        return "this is returned";


    echo $this->methodblock();
  • Test it moving test.xml file to frontend/base/default/layout/ folder. – mageUz Jan 14 '15 at 14:44

I believe <impulse_test_index_index> is incorrect.

In your case it should be <test_index_index>, where Test is the modulename : from Namespace_Modulename (Impulse_Test), and index and index are the controller and actions.

If you update that in app\design\frontend\impulse\theme\layout\test.xml it should work.

  • Note if that doesn't work you can also do something like <default><remove name="root"/></default> within that layout XML file just too see if the xml file is working. (that bit of code should remove all the content on homepage if it does then you know the file is being loaded) – James Anelay - TheExtensionLab Jan 14 '15 at 21:41

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.