Created a custom module with admin grid and a front end rout admin section is working fine but when i visit the front end page it was going to 404 that issue is fixed now Showing Blank page instead of showing real information.
Here is my config.xml
<?xml version="1.0"?>
<config>
<modules>
<MageSf_OrderCustom>
<version>1.0.1</version>
</MageSf_OrderCustom>
</modules>
<global>
<blocks>
<ordercustom>
<class>MageSf_OrderCustom_Block</class>
</ordercustom>
</blocks>
<helpers>
<ordercustom>
<class>MageSf_OrderCustom_Helper</class>
</ordercustom>
</helpers>
<models>
<magesf_ordercustom>
<class>MageSf_OrderCustom_Model</class>
<resourceModel>magesf_ordercustom_resource</resourceModel>
</magesf_ordercustom>
<magesf_ordercustom_resource>
<class>MageSf_OrderCustom_Model_Resource</class>
<entities>
<review>
<table>magesf_ordercustom</table>
</review>
</entities>
</magesf_ordercustom_resource>
</models>
<resource>
<magesf_ordercustom_setup>
<setup>
<module>MageSf_OrderCustom</module>
</setup>
<connection>
<use>core_setup</use>
</connection>
</magesf_ordercustom_setup>
<magesf_ordercustom_write>
<connection>
<use>core_write</use>
</connection>
</magesf_ordercustom_write>
<magesf_ordercustom_read>
<connection>
<use>core_read</use>
</connection>
</magesf_ordercustom_read>
</resource>
</global>
<adminhtml>
<layout>
<updates>
<ordercustom>
<file>magsf_ordercustom.xml</file>
</ordercustom>
</updates>
</layout>
</adminhtml>
<frontend>
<layout>
<updates>
<ordercustom>
<file>ordercustom.xml</file>
</ordercustom>
</updates>
</layout>
</frontend>
<admin>
<routers>
<adminhtml>
<args>
<modules>
<MageSf_OrderCustom after="Mage_Adminhtml">MageSf_OrderCustom_Adminhtml</MageSf_OrderCustom>
</modules>
</args>
</adminhtml>
</routers>
</admin>
<frontend>
<routers>
<ordercustom>
<use>standard</use>
<args>
<module>MageSf_OrderCustom</module>
<frontName>Order Attachment</frontName>
</args>
</ordercustom>
</routers>
</frontend>
here is the front end layout XML file:
<?xml version="1.0"?>
<layout version="0.1.0">
<customer_account>
<reference name="customer_account_navigation">
<action method="addLink" translate="label" module="ordercustom">
<name>ordercustom</name>
<path>ordercustom/customer/view</path>
<label>Order Attachments</label>
</action>
</reference>
</customer_account>
<ordercustom_customer_view>
<update handle="customer_account"/>
<reference name="content">
<block type="ordercustom/ordercustom" name="view.ordercustom" template="ordercustom/customer/view.phtml"/>
</reference>
</ordercustom_customer_view>
</layout>
And this is the controller file for front end module:
<?php
class MageSf_OrderCustom_CustomerController extends Mage_Core_Controller_Front_Action
{
/**
* Checking if user is logged in or not
* If not logged in then redirect to customer login
*/
public function preDispatch()
{
parent::preDispatch();
if (!Mage::getSingleton('customer/session')->authenticate($this)) {
$this->setFlag('', 'no-dispatch', true);
// adding message in customer login page
Mage::getSingleton('core/session')
->addSuccess(Mage::helper('ordercustom')->__('Please sign in or create a new account'));
}
}
/**
* View Your Module
*/
public function viewAction()
{
$this->loadLayout();
$this->getLayout()->getBlock('head')->setTitle($this->__('Order Attachment'));
$this->renderLayout();
}
}
?>