Magento CE 1.9.4.5
I created a module and successfully had it loaded. The xml is below:
<?xml version="1.0" encoding="UTF-8"?>
<layout>
<default>
<reference name="header">
<block type="core/template" name="mymodule.topbar" template="topbar/content.phtml"/>
</reference>
</default>
</layout>
As you can see, the content is the reference name="header"
in topbar/content.phtml
is loaded by calling $this->getChildHtml('mymodule.topbar')
in header.phtml
.
I wonder if I still need to load the topbar even when header is not used, so changed the xml to:
<?xml version="1.0" encoding="UTF-8"?>
<layout>
<default>
<reference name="root">
<block type="core/template" name="mymodule.topbar" template="page/html/topbar.phtml"/>
</reference>
</default>
</layout>
I copied the content.phml
file to app/design/frontend/mymodule/mytheme/template/page/html
and renamed it to topbar.phtml
. It suddenly doesn't load anymore and I can't see anything wrong.
Any one please give me some advice. Thanks in advance.