HI,
I am trying to create a router for my custom module.
I would like to access index controller's hotsale action by url/hotsale. So I create the following router xml in my module's config.xml.
<hotsale>
<use>standard</use>
<args>
<module>Moon_Products</module>
<frontName>hotsale</frontName>
</args>
</hotsale>
when I access url/hotsale, it goes to index controller's index action. How do I make it to execute hotsale action?
I tried to add hotsale, but it didn't work.
I took Alan Storm's suggestion and ended with the following code.
public function indexAction()
{
if($this->getRequest()->getRouteName() == 'hotsale'){
$this->loadLayout();
$block = $this->getLayout()->createBlock(
'Mage_Core_Block_Template',
'my_block_name_here',
array('template' => 'moon/hotsale.phtml')
);
$this->getLayout()->getBlock('root')->setTemplate('page/product-without-rightbar.phtml');
$this->getLayout()->getBlock('content')->append($block);
$this->renderLayout();
}
}