Magento does not load layout

Asked

Viewed 464 times

-1

By following the Magento documentation, I can’t change the content of a custom controller. It looks like the file. xml is not read but it does not return me any error and the route is working perfectly meumagento.com/default/home/index

- app
-- code
--- local
---- MarceloWeb
----- Default
------ controllers
------- HomeController.php
------ etc
------- config.xml

Homecontroller.php

class MarceloWeb_Default_HomeController extends Mage_Core_Controller_Front_Action
{
    public function indexAction()
    {
        $this->loadLayout();
        $this->renderLayout();
    }
}

config.xml

    <modules>
        <MarceloWeb_Default>
            <version>0.0.1</version>
        </MarceloWeb_Default>
    </modules>

    <frontend>
        <routers>
            <MarceloWeb_Default>
                <use>standard</use>
                <args>
                    <module>MarceloWeb_Default</module>
                    <frontName>default</frontName>
                </args>
            </MarceloWeb_Default>
        </routers>

        <layout>
            <updates>
                <default>
                    <file>home.xml</file>
                </default>
            </updates>
        </layout>
    </frontend>

</config>


- app
-- design
--- frontend
---- default
----- default
------ layout
------- home.xml
------ template
------- abc
-------- home.phtml

home.xml

<?xml version="1.0" ?>
<!-- Root node for Magento layout configuration -->
<layout version="0.1.0">
    <!--Page handle -->
    <default_home_index>
        <!-- reference tag specifies the block where we a going to add child block -->
        <reference name="content">
            <!-- Our page content block -->
            <block type="core/template" name="home" template="abc/home.phtml"></block>
        </reference>
    </default_home_index>
</layout>

home.phtml

< p >Hello World!< / p>

1 answer

0

Have you tried calling an existing block to see if it’s even calling home.xml? it seems to me, it may be the references within the layout that are wrong

Browser other questions tagged

You are not signed in. Login or sign up in order to post.