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

Reference to my custom module’s block type in layout file is not working
 
thungk
Jr. Member
 
Total Posts:  20
Joined:  2009-06-10
 

I have a custom module with a block file (View.php) and template file (view.phtml).  In the layout file, I have the the following:

<mymodule_index_index>
     <
reference name="root">
        <
action method="setTemplate"><template>mymodule/mymodule-1column.phtml</template></action>
        <
block type="mymodule/view" name="mymoduleview" as="content" template="mymodule/view.phtml"></block>
     </
reference>
    </
mymodule_index_index>

When I set the block type to core/template or any of the Mage block types (catalog/product or checkout/cart for ex.), the contents of my template file display.  However, nothing displays when I set the block type to the above mymodule/view.  What could I possibly be missing that would otherwise make this work?  Any help would be much appreciated!  I have been trying to get this to work for days, and it is very frustrating :(

 
Magento Community Magento Community
Magento Community
Magento Community
 
Magestore
Mentor
 
Avatar
Total Posts:  1015
Joined:  2009-08-07
Viet Nam
 

Not sure what you want but I think you should try this

<mymodule_index_index>
     <
reference name="root">
        <
action method="setTemplate"><template>mymodule/mymodule-1column.phtml</template></action>        
     </
reference>
     <
reference name="content">
       <
block type="mymodule/view" name="mymoduleview" as="content" template="mymodule/view.phtml"></block>
     </
reference>
    </
mymodule_index_index>
 
Magento Community Magento Community
Magento Community
Magento Community
 
thungk
Jr. Member
 
Total Posts:  20
Joined:  2009-06-10
 

MageStore, thanks for your suggestion.  I tried that, but I am having the same issue.  core/template works as a block type, but not mymodule/view.  Any other ideas?

 
Magento Community Magento Community
Magento Community
Magento Community
 
thungk
Jr. Member
 
Total Posts:  20
Joined:  2009-06-10
 

Nevermind, I found my module was disabled in my modules list.  I did this a while ago and forgot I did so, doh!  rasberrysmile

 
Magento Community Magento Community
Magento Community
Magento Community
 
kalloszsolty
Jr. Member
 
Total Posts:  1
Joined:  2012-12-27
 
thungk - 21 August 2009 12:06 PM

Nevermind, I found my module was disabled in my modules list.  I did this a while ago and forgot I did so, doh!  rasberrysmile

I’ve been debugging my module for 3 days. You saved me whit this information . EPIC facepalm for me to.

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