Home Ask Login Register

Developers Planet

Your answer is one click away!

TT120 February 2016

Custom Module Page Not Rendering Template - Magento

I'm developing a custom module for a new form (nothing fancy). I've created a custom template and I'm trying to render through my controller (I've tried XML too but that didn't work) using:


But when I go to the page I get the site's header and footer etc. but not the content.

Here are my files:


    class Class_Module_IndexController extends Mage_Core_Controller_Front_Action {
        public function preDispatch() {
        public function indexAction() {
        public function postAction() {
            $_post = $this->getRequest()->getPost();
            // form fields
            $_name        = $_post['name'];
            $_to          = $_post['email'];
            $_phoneModel  = $_post['phone_model'];
            $_phoneNumber = $_post['phone_number'];
            $_issue       = $_post['issue'];
            // email set up
            $_subject = 'A Subject';
            $_message = 'Hey, ' . $_name . 'said that there phone (' . $_phoneModel . ') has the following issue:';
            $_message .= $_issue;
            $_message .= 'Their number is ' . $_phoneNumber;
            // magento mail set up
            $_mail = Mage::getModel('core/email');
            // send mail
            try {
                Mage::getSingleton('customer/session')->addSuccess('Email sent successfull        


kuba_ceg February 2016

Weird way of defining layout (in config.xml). I've never seen something like this :D Maybe try define layout in standard way with separate xml file, here http://www.webspeaks.in/2010/07/create-your-first-magento-module.html You have tutorial. Since 5 years I make modules like that and it work :)

Post Status

Asked in February 2016
Viewed 3,435 times
Voted 13
Answered 1 times


Leave an answer

Quote of the day: live life