Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Trouble making layout for custom module
 
cosmicbandito
Jr. Member
 
Total Posts:  16
Joined:  2008-06-04
 

Hello,

I’m a relatively new to magento but allready have to customize it and generate a module. I’m totally stuck on generating a layout and frontend output for my module. I think I halfway understand the structure and architecture of the modules. I mean it’s hard to find it out by myself unless there are no real documentations on that.

Anyway, so here comes what I did so far:
- generated a module like my_package/my_module
- configured it and made all that admin stuff, which works perfectly.

Now I wanted to display something in the frontend. So I added following things to my_package/my_module/etc/config.xml:

<global>
        <
blocks>
            <
my_module><class>MyPackage_MyModule_Block</class></my_module>
        </
blocks>
  </global>
  ...
  <
frontend>
      <
layout>
          <
updates>
              <
my_module>
                  <
file>my_layout.xml</file>
              </
my_module>
          </
updates>
      </
layout>      
    </
frontend>

And generated a my_layout.xml file like that:

<layout version="0.1.0">
     <default>
        <
reference name="footer">
            <
block type="my_module/myblockclass" name="test123">
                <
action method="setUid"><uid>test</uid></action>
            </
block>
        </
reference>
     </default>
 </
layout>

But the problem is, that the contents of this file are completely ignored. Just for testing I’ve copied the default block to another core-layout file and the output worked perfectly. So I deleted the <layout> part of my_layout.xml and as result a parsing Error occured. Then I just changed the layout-filename in config.xml and the parsing error disappeared.
So it seams to me that the file is parsed but the default block ignored.

I’m sitting and searched for hours on that without any success so far. Has it something to do with the package? When I tried to understand the modules framework I generated a module for testing in the Mage Package, and there the output worked.

So if anyone has a glue I would be more then pleased.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top