I just installed the module and it works fine. Thanks.
I use it in a right aligned vertical menu and like to have some space between the icon and the text. I changed manually the menu_icons.css file from padding-right:16px; to padding-right:22px;. (the icons are 16px wide). But it is a burden to do this every time I change a menu or worse, when a customer does the change.
I can do this for all icons, but it would be nice if this could be a settings question.

CommentFileSizeAuthor
#9 交通指引 - 天地海民宿.jpg8.78 KBmubiesam

Comments

Tino’s picture

Found it impossible to create a general solution with css, but managed to create some whitespace after the menu-icon with the ImageCache Actions module (http://drupal.org/project/imagecache_actions).

I added the following actions to the menu_icon ImageCache preset:

  • Add action "Scale And Crop" for desired icon size (E.g. 16x10)
  • Add action "Define Canvas"
    • Set background color, E.g. ffffff
    • Check "Resize canvas under image (possibly cropping)"
    • Set exact size (E.g. 21x10 for 5 px spacing) and set X left, Y center

Hope it helps!

promes’s picture

Thank you 10o for your answer. For my original site it is to big an overhead: I only use one icon in the menu.
I think this module will be a great help for a current project of mine. Your comment arrives just at the moment I am thinking how to implement some of the possibilities of ImageCache Actions provides.

Anandkumar’s picture

Version: 6.x-2.4 » 7.x-3.0-beta3

+1 for need of a settings page to specify padding between icon and text.
I worked around this by modifying the menu_icons_css_item.tpl.php to:

<?php

 $padding=1;
?>
a.menu-<?php print $mlid ?>, ul.links li.menu-<?php print $mlid ?> a {
  background-image: url(<?php print $path ?>);
  padding-<?php print "$pos:".($size+$padding)?>px;
  background-repeat: no-repeat;
  background-position: <?php print $pos?>;
  height: <?php print $size?>px;
}

This, of course, only affects new menu icons you add after making this change.

promes’s picture

Thanks Anandkumar for pointing out this possibility. I immediately implemented it.

acrollet’s picture

Category: feature » support
Status: Active » Fixed

@promes: please note that you may copy the template to your active theme's directory and edit it there, to avoid having to re-do your edits every time you update menu_icons.

promes’s picture

Hello acrolet,

Thanks for your update. I already have been aware of this.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

xaa’s picture

Issue summary: View changes

since the time ... is there a better way to fix this issue ?

mubiesam’s picture

StatusFileSize
new8.78 KB

I installed Version: 7.x-3.0-beta4+0-dev

Tried both ways...
1. menu_icon ImageCache preset actions introduced by Tino
2. modifying the menu_icons_css_item.tpl.php introduced by Anandkumar

But the icon still glued together with text as the screenshot, Is there any change since then...

Thanks,

mubiesam’s picture

Version: 7.x-3.0-beta3 » 7.x-3.0-beta4
Status: Closed (fixed) » Active