I installed the Menu Image module, enabled it, created a new menu link and uploaded image for the icon. It did not show up at the front, only displays menu link title.

I got so frustrated...been hours & hours trying to make it work but couldn't.

Please help... I wonder is this is a bug?

hc.

Comments

Anks’s picture

Hi Hanjaya,

Can you please provide url of the site. So I can review the site.

There can be possibilities.

[1] Menu can be different.
[2] Theming issue (css edit requires)
[3] Module issue.

Ankit Hinglajia

chanjay’s picture

Hi Anks,

I have tried both main menus from the theme and core. None of them work. I am using the Omega 4 theme. What should I do with the CSS edit?

Thanks,

hc.

Anks’s picture

Hi Hanjaya,

Yes you are right, I have checked with menuimage module. It is not working with my end too.

I have checked issue queue of this module.and have found that this module will not display image unless you then code it in your theme.

You can check similar module https://drupal.org/project/menu_icons

Hope this will help you.

Ankit Hinglajia

chanjay’s picture

Hi Ankit,

Do you know how to code it in the theme? I had tried the menu-icons module as well and did not show up either, but I didn't really spend time looking into it though.

Let me know if you know how to code it.

Thank you so much.

hc.

gausarts’s picture

Tried clearing cache at admin/config/development/performance?
BTW, is it menu_icons?

love, light n laughter

chanjay’s picture

Yes, I did this all the time but no luck.

Thank you.

hc.

gausarts’s picture

Have you checked the source code that the menu_icon class is there?
If so it may be related to your CSS need some fixing.

love, light n laughter

chanjay’s picture

Hi,

Yes, I saw the class is there.

hc.

gausarts’s picture

After clearing the cache from the /admin page, use Firebug to check if that class with a specific MLID actually refers to an existing background image. Otherwise your issue is here.

Once the menu icon loadded properly, try adding:

.menu_icon {
  display: block;
}

Just in case it collapsed. Maybe proper padding and line-height will help.

love, light n laughter

chanjay’s picture

Hi,

I plugged in that code in my css & refresh the cache, nothing happened.

This is what stated on Chrome developer tools.

<li class="last leaf" title="Web projects">
<a href="/main/?q=web_projects" title class="menu_icon menu-340"></a>
</li>

hc.

kris-o3’s picture

it works as designed - there is no currently no theme hook implemented, only the ability to upload an image to be associated with a menu item, in the admin.
you're 'on your own' (for the foreseeable future) in terms of displaying the image in your frontend/theme.
see also:
https://drupal.org/node/1980656
and the readme / documentation in the module itself explains how to display/access the image for display via php.

junelau’s picture

In a template file:

$social_menu = menu_tree_all_data('menu-footer-social-links');
      foreach ($social_menu as $link):
        $file = file_load($link['link']['options']['content']['image']); ?>         
        <a href="<?php print url($link['link']['link_path']) ?>" target="_blank" title="<?php print t('View on '). " " .$link['link']['link_title'];?>"><?php print theme('image_style', array(
            'style_name' => 'large',
            'path' => $file->uri
          )); ?>
        </a>
      <?php endforeach; ?>