Jump to content

How to Change Admin Login Redirection


Walter

Recommended Posts

You can set default page to "Modules" but you cannot redirect to specific module configuration page.

You can also set default page to specific "Admin Module Page" if it already registered as an Admin Menu.

If you still wanna set default page to specific module configuration page, then you must do several changes as follow :

  1. create module admin controller file simply with just a __construct() method and add redirection inside it
    <?php
    
    class Admin[REPLACE_WITH_MODULE_NAME]ConfigController extends ModuleAdminController
    {
        public function __construct()
        {
            parent::__construct();
    
            Tools::redirectAdmin(
              $this->context->link->getAdminLink('AdminModules').
              '&module_name=[replace_with_module_name]&configure=[replace_with_module_name]'
            );
        }
    }

     

  2. create new Admin Menu pointing to the newly created module controller (Admin > Administration > Menu)
    Name: "as you wish"
    Class : "Admin[REPLACE_WITH_MODULE_NAME]ConfigController"
    Module : "real_module_name"
    Status : YES
    Parent: Home
  3. edit your admin profile
  4. you will see the new Admin Menu on the dropdown of "Default Page" field option
  5. select the newly created menu as your default page
Link to comment
Share on other sites

It works. Thanks! 

However, what I did was just by specifying the target module's controller name in the method below instead of 'AdminModules'.

Tools::redirectAdmin(
          $this->context->link->getAdminLink('Admin[Module Name]').
        );
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...