Jump to content

link to module in admin


socode

Recommended Posts

Hi everybody,

 

This is my first time working with Prestashop, and so far it's going great! However, there is one thing I can't figure out: how to put a direct link to a specific installed module in the menu on the left in Prestashop admin. The URL to the module is as following: 

index.php?controller=AdminModules&token=xxx&configure=homeslider&tab_module=front_office_features&module_name=homeslider

 

This is what I've tried:

 

1. In Administration > Menus, I added a menu with name: Homeslider, class: AdminModules and module: homeslider. Now a menu was created, but when I click it, it says: Controller not found. Also when I click Modules > Modules now the same message Controller not found shows up.

 

2. I've tried creating my own AdminController, and redirect to the URL in this controller. So in /controllers/admin I created the file AdminSchomepageController.php. This is the content of the file:

<?php

class AdminSchomepageController extends AdminController
{

	public function __construct()
	{
    		parent::__construct();
	}

	public function initContent()
        {
		// index.php?controller=AdminModules&token=xxx&configure=homeslider&tab_module=front_office_features&module_name=homeslider
		$url  = 'index.php?controller=AdminModules';
		$url .= '&token='.Tools::getAdminTokenLite('AdminModules');
		$url .= '&configure=homeslider&tab_module=front_office_features&module_name=homeslider';
		Tools::redirectAdmin($url);

        }

}

Then I edited the menu I created, putting in class: AdminSchomepage and emptying the field module. I save it, but now when I click the menu item it shows a white screen, no error message.

 

These are the methods I tried, but I had no luck so far. Can anyone show me how it can be done?

Link to comment
Share on other sites

  • 6 months later...

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...