Next Webinar: Maximizing Magento - Get the Most out of Promotions. Register Today!

Magento

Open Source eCommerce Evolved

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:  1771
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>

 Signature 

- I would love to change the world, but they won’t give me the source code -

 
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
 
Sales: Call 877.832.5289 (North America) 310.295.4144 (International)
© Copyright 2008 Varien. Magento is a trademark of Irubin Consulting Inc. DBA Varien
Privacy Policy|Terms of Service
Magento Community Count
41087 users|811 users currently online|87759 forum posts