Jump to content

Trouble in Creating a new menu item in admin for a module config page


Kourosh.narian@gmail.com

Recommended Posts

Hi,
I am using Prestashop 1.6.1.5 I have tried to make a new menu item in the admin area for showing configure page of "Image slider for your homepage v1.6.1 – developed by PrestaShop" Module.

So I did as following:
1. I click Administration - > Menus
2. I created a new menu option by clicking the "Add new menu" icon at the top-right of the form.
3. There is a textbox for menu item name. I type "Slider" for this.
4. A textbox for class and a text box for module.

According to Prestashop User's Guide I try to fill correct data for Class and Module textboxes but when I click on new menu item (Slider), Prestashop can not show this module's configure page and the browser show me the following message:

"The localhost page isn’t working
localhost is currently unable to handle this request.
HTTP ERROR 500"


For solving this problem, I navigate to "Image slider for your homepage" module's configure page and then I created a new menu item on the Quick Access.
Then I clicked on this menu item for analyzing the generated URL by the browser:

http://localhost/......037284a9d1da538

I have guessed the Class should be " AdminModules " or "homeslider" and the Module should be "homeslider". But I got the same result.
I did not understand how can I fetch the correct data for Class and Module textboxes from this URL.

At last, as you know, "Image slider for your homepage" is only an example for this issue. So my questions is that:
1. What I should fill for this module for Class and Module textboxes?
2. How can I find the Class and Module name for other Modules?

The following text is the Prestashop User's Guide for this issue:

"Creating a new page or menu
Click on the "Add New Menu" button to reach the page creation form.
• Name. Give it a unique name, because it will serve as an internal identifier.
• Class. In short, a PrestaShop back office page is based on specific internal PHP files, which are called "admin controllers", and are most often stored in the /controllers/admin folder of your PrestaShop installation. When creating a new page, you must know which controller to target, and most importantly the name of its class – which is the name of its PHP file.
For instance, if you want to create a page displaying PrestaShop's backup administration page, you must first find its controller name (in this case, AdminBackupController), and copy it in the "Class" field.
• Module. In some cases, the administration controller for which you want to create a page comes from a module. In that case, you must also indicate the identifier for the module (in most cases, its folder name) and copy it in the "Module" field, in lowercase. This way, PrestaShop will know that it should not look for the controller in the /controllers/admin folder, but rather in the /modules/NAME-OF-THE-MODULE/ folder."


Thanks for any help.

Link to comment
Share on other sites

You can't create a menu for a module configuration page.

Menu is only for:

- An independent admin page which you usually can find them under /controllers/admin/

- An independent module admin page which usually can find them under modules/module-name/controllers/admin/

 

When I say "page", I'm talking about a controller, technically to say.

The configuration page of a module is just a small part of the AdminModules page.

As a result, you can't link to a part of controller (page) in this case.

 

Developers want to offer this ability, they have to create a module admin page

 

Hope that helps!

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