Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
edited title
Link
bestwebdevs
  • 187
  • 2
  • 20

Resolved - Admin Grid Redirects to Front End Page Instead of Backend

deleted 3499 characters in body
Source Link
bestwebdevs
  • 187
  • 2
  • 20

Please helpI took steps according to resolve this: I article but the newly created a new Tab for my module inlink displays the admin panel (next to System). But it redirects to a"text block" on the front page-end instead of backend page. I need it to display a backend page where I will create a grid filter,etcback-end.

Here is the config file code:

     <config>
<modules>
    <Cpstest_ProductComments>
        <version>0.1.0</version>
    </Cpstest_ProductComments>
</modules>
<frontend>    
    <layout>
        <updates>
            <productcomments module="Cpstest_ProductComments">
                <file>productcomments.xml</file>
            </productcomments>
        </updates>
    </layout>
    <routers>
        <productcomments>
            <use>standard</use>
            <args>
                <module>Cpstest_ProductComments</module>
                <frontName>productcomments</frontName>
            </args>
        </productcomments>          
        <adminhtml>
            <args>
                <modules>
                    <module_name before="Mage_Adminhtml">Cpstest_ProductComments_Adminhtml</module_name>
                </modules>
            </args>
        </adminhtml>            
    </routers>
</frontend>   
<global>
<models>
        <productcomments>
            <class>Cpstest_ProductComments_Model</class>
        </productcomments>
    </models>       
     <resources>
     <productcomments_setup>
            <setup>
                <module>Cpstest_ProductComments</module>
                <class>Mage_Eav_Model_Entity_Setup</class>
               <class>Cpstest_ProductComments_Model_Resource_Mysql4_Setup</class>
                <class>Mage_Catalog_Model_Resource_Setup</class>
            </setup>
            <connection>
                <use>core_setup</use>
            </connection>
        </productcomments_setup>   
        <productcomments_write>
            <connection>
                <use>core_write</use>
            </connection>
        </productcomments_write>
        <productcomments_read>
            <connection>
                <use>core_read</use>
            </connection>
        </productcomments_read>
    </resources>
    <helpers>
        <productcomments>
            <class>Cpstest_ProductComments_Helper</class>                                                             
        </productcomments>            
    </helpers>
    </global>                                   
    <adminhtml>
    <menu>
    <backend_menu translate="title" module="productcomments">
            <title>CPS Product Comments</title>
            <sort_order>9999</sort_order>
            <children>
                <first_page module="productcomments">
                    <title>Product Comments</title>
                    <action>productcomments/index/index</action>
                </first_page>
            </children>
    </backend_menu> 
    </menu>
    </adminhtml>
    </config>

And here is my controller file function:

        public function indexAction()
    {
        $this->loadLayout();

        //create a text block with the name of "example-block"
         $block = $this->getLayout()
         ->createBlock('core/text', 'example-block')
         ->setText('<h1>This is a text block</h1>');

        //$this->_addContent($block);
        $this->getLayout()->getBlock('content')->append($block);            
        
        
        
        $this->renderLayout();
    }   

I'm using this article and it's taking to a backend page in his example: http://alanstorm.com/magento_admin_controllers/

Here is the front-end page where the link redirects

Can anyone help me understand what's the problem? Greatly appreciate your help guys!

Please help to resolve this: I created a new Tab for my module in the admin panel (next to System). But it redirects to a front page instead of backend page. I need it to display a backend page where I will create a grid filter,etc.

Here is the config file code:

     <config>
<modules>
    <Cpstest_ProductComments>
        <version>0.1.0</version>
    </Cpstest_ProductComments>
</modules>
<frontend>    
    <layout>
        <updates>
            <productcomments module="Cpstest_ProductComments">
                <file>productcomments.xml</file>
            </productcomments>
        </updates>
    </layout>
    <routers>
        <productcomments>
            <use>standard</use>
            <args>
                <module>Cpstest_ProductComments</module>
                <frontName>productcomments</frontName>
            </args>
        </productcomments>          
        <adminhtml>
            <args>
                <modules>
                    <module_name before="Mage_Adminhtml">Cpstest_ProductComments_Adminhtml</module_name>
                </modules>
            </args>
        </adminhtml>            
    </routers>
</frontend>   
<global>
<models>
        <productcomments>
            <class>Cpstest_ProductComments_Model</class>
        </productcomments>
    </models>       
     <resources>
     <productcomments_setup>
            <setup>
                <module>Cpstest_ProductComments</module>
                <class>Mage_Eav_Model_Entity_Setup</class>
               <class>Cpstest_ProductComments_Model_Resource_Mysql4_Setup</class>
                <class>Mage_Catalog_Model_Resource_Setup</class>
            </setup>
            <connection>
                <use>core_setup</use>
            </connection>
        </productcomments_setup>   
        <productcomments_write>
            <connection>
                <use>core_write</use>
            </connection>
        </productcomments_write>
        <productcomments_read>
            <connection>
                <use>core_read</use>
            </connection>
        </productcomments_read>
    </resources>
    <helpers>
        <productcomments>
            <class>Cpstest_ProductComments_Helper</class>                                                             
        </productcomments>            
    </helpers>
    </global>                                   
    <adminhtml>
    <menu>
    <backend_menu translate="title" module="productcomments">
            <title>CPS Product Comments</title>
            <sort_order>9999</sort_order>
            <children>
                <first_page module="productcomments">
                    <title>Product Comments</title>
                    <action>productcomments/index/index</action>
                </first_page>
            </children>
    </backend_menu> 
    </menu>
    </adminhtml>
    </config>

And here is my controller file function:

        public function indexAction()
    {
        $this->loadLayout();

        //create a text block with the name of "example-block"
         $block = $this->getLayout()
         ->createBlock('core/text', 'example-block')
         ->setText('<h1>This is a text block</h1>');

        //$this->_addContent($block);
        $this->getLayout()->getBlock('content')->append($block);            
        
        
        
        $this->renderLayout();
    }   

I'm using this article and it's taking to a backend page in his example: http://alanstorm.com/magento_admin_controllers/

Here is the front-end page where the link redirects

I took steps according to this article but the newly created link displays the "text block" on the front-end instead of back-end. http://alanstorm.com/magento_admin_controllers/

Here is the front-end page where the link redirects

Can anyone help me understand what's the problem? Greatly appreciate your help guys!

added 112 characters in body
Source Link
bestwebdevs
  • 187
  • 2
  • 20

Here is the front-end page where the link redirects

Here is the front-end page where the link redirects

added 93 characters in body
Source Link
bestwebdevs
  • 187
  • 2
  • 20
Loading
deleted 303 characters in body; edited tags; edited title
Source Link
bestwebdevs
  • 187
  • 2
  • 20
Loading
Source Link
bestwebdevs
  • 187
  • 2
  • 20
Loading