1

i am learning to create a module from here.

http://devdocs.magento.com/guides/m1x/magefordev/mage-for-dev-4.html

And on in this article everything is fine even workin also but i want to know where local.xml file is declared.

app/design/frontend/base/default/layout/local.xml


When i call this action method how it know that it have to load template from layout/local.xml. why it did not try to load template from other xml file?

public function call_blockaction() {
//remove our previous echo
//echo 'Hello Index!';
$this->loadLayout();
$this->renderLayout();
}

1 Answer 1

4

local.xml is only used as part of your custom theme and should not be used when creating a module. If you have your own layout instructions use something like

<config>
    <frontend>
        <layout>
            <updates>
                <fooman_example>
                    <file>fooman_example.xml</file>
                </fooman_example>
            </updates>
        </layout>
    </frontend>
</config>

and then create the file app/design/frontend/base/default/layout/fooman_example.xml

2
  • do you mean it works like default layout xml file? what happen if i will delete local.xml? when i create module it was not there? Commented Dec 2, 2015 at 2:42
  • Not sure that I understand the last comment, again if you are developing a custom module you should never need to have a local.xml. If you are customising a theme then using a local.xml is the recommended approach see for example inchoo.net/magento/… Commented Dec 2, 2015 at 23:12

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.