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

Problem with layout.xml file, cant get content to display…
 
danpowered
Jr. Member
 
Total Posts:  9
Joined:  2008-05-01
 

Hi, im pretty new with this framework, but after 2 days of strolling through the code, i begin to understand many parts.

Now im testing by developping a new extension.  So here are the steps i went through (lets say for simplicity’s sake that the package and modules are named Package and Module.)

1- Created the folder for my package and module in local (following the same naming conventions found in code/Mage, so Package/Module)
2- Created a controllers, Blocks and Models folders and the files pertaining to them (i created a default indexAction function in the controller, which i called Package_Module_IndexController, and a block named Display.php containing nothing a the moment.)
3- Registered it through a xml file in app/etc, using the same structure that i found in a payment module solution, and named it Package_Module.xml
4- Created a module.xml file in the design/frontend/default/default/layout, following examples in the designer’s guide
5- And finally, added a display.phtml in the design/frontend/default/default/template directory, containing some text to test.

Now, i cant get the content to show in the page.  I know most of the code works because i can change the template layout from 1column to 3columns by changing it in the module.xml file in the layout directory, but my specific content doesnt show.  I tried picking a block from another layout.xml file (wishlist.xml for example), and the content from that block loads.

Here’s the line i wrote for my content block :

<block type="module/display" name="module.display" template="module/display.phtml"/>

Do I need to specify to the layout xml that the code isnt found in the code directory but in the local directory, as i did in the module registration with code_pool?  Or is there something wrong with my xml line found above?

Thanks for helping if you have any idea!

 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1770
Joined:  2007-08-07
Los Angeles
 

in your app/code/local/Package/Module/etc/config.xml should be block group configuration:

<config>
..
  <global>
..
    <
blocks>
      <
mymodule>
        <class>
Package_Module_Block</class>
      </
mymodule>
    </
blocks>
 
Magento Community Magento Community
Magento Community
Magento Community
 
danpowered
Jr. Member
 
Total Posts:  9
Joined:  2008-05-01
 

Yes!

That was it.  Thank you very much!

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