Jump to content

[solved] How do I set admin root menu icon?


Recommended Posts

Solved!

 

please give the solution, we would appreciate

a little part of forum rules:

 

[sOLVED] Topic

 

If, after posting a topic, you find a solution to your problem, please indicate it in your post and describe the solution.

There is nothing more frustrating for users with the same issue who come across your post "all is good, I fixed it..." without an explanation of how to fix it.

 

Furthermore if you are the author of the topic for which a solution has been found, please edit your topic title to mark it as [sOLVED].

 

To mark a topic as [solved] :

- Edit the first post of your topic by clicking on the "Edit" button,

- Click on the "Use full editor" button,

- Add the "[solved]" string at the beginning of your topic title and click on the "Submit Modified Post" button.

 

Posters who do not abide by this (at the demand of the moderators or other users) will have their new topics closed until the problem has been resolved.

Link to comment
Share on other sites

Just inspect the image with the question mark in chrome, and its src attribute will give you an indication of where the image needs to be and what you need to call it.

 

Make sure you got the case right.

 

many thanks for sharing your solution, now i can go ahead and mark thread as solved

regards

Link to comment
Share on other sites

  • 11 months later...

In pretashop 1.5 to show an icon for main menu in a admin module , that is enough to have gif image in your module folder by name of tab name

for example when you create a new tab lik this
 

$tab = new Tab();
$tab->class_name = 'MyModule';
$tab->module = 'mymodule';
$tab->id_parent = 0;
foreach (Language::getLanguages(false) as $lang)
        $tab->name[(int) $lang['id_lang']] = 'MyModule';

you should put MyModule.gif image in your module folder ---->>>>> <prestashop root folder>/modules/mymodule/MyModule.gif


but in prestashop 1.6 and in bootstrap icon I've not found any way to asign a bootstrap icon to my module meno
if any one find please share it

Edited by masoud2011 (see edit history)
Link to comment
Share on other sites

  • 7 months later...

@masoud2011

 

in prestashop 1.6 you can achieve it as follows:
1- Check the css class of the new tab you made (it should be like this "icon-AdminMyModule" assuming your admin controller for the tab name is "AdminMyModuleController".

2- Create a css file in your module "menuTabIcon.css" and add the code you need, for example:
 

.icon-AdminMyModule:before{
    content: "\f021";
}

3- register your module with the "displayBackOfficeHeader" hook and implement this method:
 

 public function hookDisplayBackOfficeHeader($params) {
        $this->context->controller->addCSS(($this->_path) . 'menuTabIcon.css');
    }

You're done, this will display a refresh icon behind the menu item, if you need codes for other icons, find them here in the Fontawesome cheat sheet

Edited by sari (see edit history)
  • Like 3
Link to comment
Share on other sites

×
×
  • Create New...