1

I'm just trying to test my module by adding some text to the homepage and I can't seem to get this to work. I'm on Magento 1.7.0.2. Magento is aware of my module, I already checked that.

Here is my config:

<?xml version="1.0"?>
<config>
<modules>
    <MyPackage_MyModule>
        <version>1.0.0</version>
    </MyPackage_MyModule>
</modules>
<global>
    <blocks>
        <mymodule>
            <class>MyPackage_MyModule_Block</class>
        </mymodule>
    </blocks>
</global>
<frontend>
    <layout>
        <updates>
            <mymodule>
                <file>mymodule.xml</file>
            </mymodule>
        </updates>
    </layout>
</frontend>
</config>

Here is what I'm trying to add to the Default Handle, code is in mymodule.xml

<?xml version="1.0"?>
<layout>
<default>
    <reference name="content">
        <block type="core/text" name="redundant">
            <action method="setText"><text>Hello Again</text></action>
        </block>
    </reference>
</default>
</layout>
9
  • I copypasted your code in an empty Magento installation (1.7.0.2), works fine for me. Things I would check: - Layout cache on? - code pool is correctly configured? - echo Mage::getConfig()->getXmlString(), can you see your configuration there? – fmrng Mar 6 '13 at 16:03
  • huh, well I flushed the cache. I see my module listed in System > Config > Advanced. Where do I put the Mage::getConfig code? – jstrez77 Mar 6 '13 at 16:10
  • codepool is set to local – jstrez77 Mar 6 '13 at 16:11
  • Is config.xml under app/code/local/MyPackage/MyModule/etc/? Where did you place mymodule.xml? Is your theme correctly configured and selected in backend? – fmrng Mar 6 '13 at 16:16
  • I created a theme under app>design>frontend>default. I went to system design and clicked 'add change design' and picked my theme which correctly shows in magento now. I added a folder to app>design>frontend> called layout and put my mymodule.xml file in there. – jstrez77 Mar 6 '13 at 16:19
2

Check if your module configuration is correctly stored under

app/code/local/MyPackage/MyModule/etc/config.xml
0

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.