You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2022-10-25 09:27:47

Florian51
Member
Registered: 2019-02-21
Posts: 21

Generic Object - Add Icon

Hello,

Do you know if it is possible or if there is a way to add an icon on a generic object as for the Computers menu for example ?

Thanks for help.

Offline

#2 2023-03-16 04:45:12

rafapraz
Member
Registered: 2023-03-15
Posts: 1

Re: Generic Object - Add Icon

Hello,
Recently I came across the same problem and I opted to use the comment field of the generic object to define the menu icon. For that, I needed to change the object.class.php file, as shown in the image below.

genericobject-menu-icon-1.png

The result achieved can be seen in the image below.

genericobject-menu-icon-2.png

Offline

#3 2023-06-11 22:22:30

HoracioDos
Member
Registered: 2023-06-10
Posts: 1

Re: Generic Object - Add Icon

Hello rafapraz.
I can't see your images. How did you change object.class.php?
Thanks!

Offline

#4 2023-06-19 09:27:20

Totem974
Member
Registered: 2023-06-19
Posts: 1

Re: Generic Object - Add Icon

Hi, i'm trying to do the same thing (add icon to custom generic object).

$menu[$str_name]['icon'] =  ($type['comment'] == '') ? $type['itemtype']::getIcon() : $type['comment'];
&&
'icon' => ($type['comment'] == '') ? $type['itemtype']::getIcon() : $type['comment'],


Did try to add code from your screenshot changing object.class.php, but how to specify where is the .svg icon for getIcon  ?

Last edited by Totem974 (2023-06-19 09:28:18)

Offline

#5 2023-09-18 19:58:11

jardel.silva
Member
Registered: 2023-05-03
Posts: 1

Re: Generic Object - Add Icon

Hello Rafa, I'm Brazilian too, I would like to know in detail how you added the space in the name of the item and how you added the icon, please.

Olá rafa, sou brasileiro também, gostaria de saber em detalhes como voce adicionou o espaço no nome do item e como adicionou o ícone por gentileza.

Offline

Board footer

Powered by FluxBB