Is there any way to remove the sub-menu icons only?
I've created a new theme and was able to replace the main menu icons with my own, however I can't remove the sub-menu ones so that it is simply text. At first I thought I could do this using the
$menu->addIcon(null);
But this also removes the main menu icon
I think I can do this by removing the filenames of the appropriate icons in the theme.php but it's not immediately obvious which ones I need to remove. I've had a search of the forum but nothing is jumping out at me.
Any tips on do this?
Screen shot here showing the icons (marked in red) I want to remove
many thanks
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I wanted to avoid modifying the core php classes and try to stick to changing my theme settings but I could not get it to work.
I started clearing the values of the array holding the small icons in my theme.php file and initially I was having some success, however I soon discovered that at least one of the icon is used else where (not just on the menus) so clearing them caused a problem.
Secondly, clearing the icon values used in the Reports menu caused a different issue as a place holder was left in the submenu for the image (which was blank). I had a look at the class and there is an coding logic error there which causes this (I believe). All the other icons use the isempty() function to check the value of the icon variable, however the reports menu build function uses isset() which is a problem as even if the icon variable is blank it is indeed set! How would I pass this along as an enhancement request.
So back to my problem…how to have no icons in the sub menus. After the problems above, my only option was to mod. the php class. So for anyone else interested in how I did it….
Edit /inclues/classes/class_menu.php
around line 253 ….
Hi all
Is there any way to remove the sub-menu icons only?
I've created a new theme and was able to replace the main menu icons with my own, however I can't remove the sub-menu ones so that it is simply text. At first I thought I could do this using the
But this also removes the main menu icon
I think I can do this by removing the filenames of the appropriate icons in the theme.php but it's not immediately obvious which ones I need to remove. I've had a search of the forum but nothing is jumping out at me.
Any tips on do this?
Screen shot here showing the icons (marked in red) I want to remove
many thanks
I'm back, with a solution I think !
I wanted to avoid modifying the core php classes and try to stick to changing my theme settings but I could not get it to work.
I started clearing the values of the array holding the small icons in my theme.php file and initially I was having some success, however I soon discovered that at least one of the icon is used else where (not just on the menus) so clearing them caused a problem.
Secondly, clearing the icon values used in the Reports menu caused a different issue as a place holder was left in the submenu for the image (which was blank). I had a look at the class and there is an coding logic error there which causes this (I believe). All the other icons use the isempty() function to check the value of the icon variable, however the reports menu build function uses isset() which is a problem as even if the icon variable is blank it is indeed set! How would I pass this along as an enhancement request.
So back to my problem…how to have no icons in the sub menus. After the problems above, my only option was to mod. the php class. So for anyone else interested in how I did it….
Edit /inclues/classes/class_menu.php
around line 253 ….
I changed it to….
So basically if this has a css class of 'submenuitem' don't do the following code (to insert the image).
I hope this helps others?
If anyone thinks I am completely wrong, please let me know. As I say I would have preferred not to mod. the classes