0

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();
  }
 } 
?>
2
  • what is the url u are trying in front nd?
    – Mujahidh
    Commented Mar 22, 2017 at 6:12
  • that one is fixed now it is showing blank page instead showing the real data on my page. can you please check that. @Mujahidh
    – Xabby
    Commented Mar 22, 2017 at 6:50

2 Answers 2

2

Problem is in your XML file at below place

<frontend>
    <routers>
        <ordercustom>
            <use>standard</use>
            <args>
                <module>MageSf_OrderCustom</module>
                <frontName>ordercustom</frontName>
            </args>
        </ordercustom>
     </routers>  
    </frontend>

In frontname you have entered "Order Attachment" where space is not allowed.

Hope it helps.

8
  • Thanks for the help, I see this and fixed. appreciate your effort.
    – Xabby
    Commented Mar 22, 2017 at 6:14
  • Welcome if its fixed for you please accept answer so it can help others as well. Commented Mar 22, 2017 at 6:14
  • There is an other issue i have land on the page but it is blank now.
    – Xabby
    Commented Mar 22, 2017 at 6:16
  • Check error in layout.xml there will be problem in layout.xml file. Commented Mar 22, 2017 at 6:17
  • that is up with this question can you please have a look?
    – Xabby
    Commented Mar 22, 2017 at 6:19
1

Fix this there was an issue with front route the front name was given wrong.

here how I create the front rout now and worked fine:

<frontend>
    <routers>
        <ordercustom>
            <use>standard</use>
            <args>
                <module>MageSf_OrderCustom</module>
                <frontName>ordercustom</frontName>
            </args>
        </ordercustom>
    </routers>  
</frontend>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.