1

I want to make custom page of admin with custom admin url but not call template for admin.If I enter in 127.0.0.1/magento19/index.php/admin_test/adminhtml_login/index so it should redirect to my my custom template(test/login.phtml) but not working .It redirects or execute default admin login page.

Path: app/code/local/Testimonial/Test/Adminhtml/LoginController.php

<?php 
class Testimonial_Test_Adminhtml_LoginController extends Mage_Adminhtml_Controller_Action
{

    public function indexAction() 
    {
       $this->loadLayout();
        $this->renderLayout();
    }
    protected function _isAllowed()
    {
         return true;
    }

}

?>

test.xml is working

app/design/adminhtml/default/default/layout/test.xml

    <admin_test_adminhtml_login_index>
         <reference name="content">
           <action method="setTemplate">
                <template>test/login.phtml</template>
            </action>
        </reference>
    </admin_test_adminhtml_login_index>

my template file location is
app/design/adminhtml/default/default/template/test/login.phtml

<div class="account-create">
        <div class="page-title">
            <h1><?php echo  $this->__('Admin Login ') ?></h1>
        </div>
        <form method="post" id="admin-login-form">



            <div class="fieldset">
                <h2 class="legend"><?php echo $this->__('Admin Login') ?></h2>
                <ul class="form-list">
                    <li class="fields">
                        <div class="field">
                            <label for="zip" class="required"><em>*</em><?php echo $this->__('Username') ?></label>
                            <div class="input-box">
                                <input type="text" name="username" title="<?php echo $this->__('Username') ?>" id="username" class="input-text required-entry" />
                            </div>
                        </div>
                    </li>
                    <li class="fields">
                        <div class="field">
                            <label for="password" class="required"><em>*</em><?php echo $this->__('Password') ?></label>
                            <div class="input-box">
                                <input type="password" name="password" id="password" title="<?php echo $this->__('Password') ?>" class="input-text required-entry validate-password" />
                            </div>
                        </div>
                    </li>
                </ul>
            </div>
            <div class="buttons-set">
                <p class="required"><?php echo $this->__('* Required Fields') ?></p>
                <button type="submit" title="<?php echo $this->__('Login') ?>" class="button"><span><span><?php echo $this->__('Login') ?></span></span></button>
            </div>
        </form>
    </div>
    <script type="text/javascript">
        //< ![CDATA[
            var customForm = new VarienForm('admin-login-form');
        //]]>
    </script>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.