I've been following this tutorial on Inchoo
Magento – Custom email contact form with notification system
I've have it working, but he has the code to display the contact form on a three comlumn layout and I need to have it display on the one column layout. Here is the code I believe is relavent:
<?php
class Inchoo_SimpleContact_IndexController extends Mage_Core_Controller_Front_Action
{
public function indexAction()
{
//Get current layout state
$this->loadLayout();
$block = $this->getLayout()->createBlock(
'Mage_Core_Block_Template',
'inchoo.simple_contact',
array(
'template' => 'inchoo/simple_contact.phtml'
)
);
$this->getLayout()->getBlock('content')->append($block);
//$this->getLayout()->getBlock('right')->insert($block, 'catalog.compare.sidebar', true);
$this->_initLayoutMessages('core/session');
$this->renderLayout();
}
public function sendemailAction()
{
//Fetch submited params
$params = $this->getRequest()->getParams();
$mail = new Zend_Mail();
$mail->setBodyText($params['comment']);
$mail->setFrom($params['email'], $params['name']);
$mail->addTo('mail@mybelovedangels.com', 'Some Recipient');
$mail->setSubject('Test Inchoo_SimpleContact Module for Magento');
try {
$mail->send();
}
catch(Exception $ex) {
Mage::getSingleton('core/session')->addError('Unable to send email. Sample of a custom notification error from Inchoo_SimpleContact.');
}
//Redirect back to index action of (this) inchoo-simplecontact controller
$this->_redirect('inchoo-simplecontact/');
}
}
?>
I've been searching on the net for the answer but I haven't had in luck getting anything to work. I think it has something to do with Mage_Core_Block_Template
.