Experimental Project

This is a sandbox project, which contains experimental code for developer use only.

Overview

This module allows you to upload an image in the menu-item's configuration form and use the image anywhere in your theme. This is useful if you want to display an image - that is related to a menu entry - somewhere in your theme (header, navigation).

The uploaded image is available at the template layer in a variable called "menu_image" along with some meta data. This module does not have any effect unless you know how to use the generated variable in your theme.

This module is Inspired by, similar to and initially based on Menu Icons, but it allows you to use the attached image anywhere in your theme, not only as a menu icon.

Features

  • Attach an image and an image description to any menu item
  • Attached image is automatically available at the template layer
  • Set a default image for all menu items
  • Compatible with ImageCache

Installation

Install as usual, see http://drupal.org/node/70151 for further information.

Configuration

  • Configure user permissions in admin/user/permissions menu_image module.
  • Customize Menu Image settings in Administer / Site Configuration / Menu Image

Usage

After installing the module you can upload an image for a menu-item at
the menu items settings form.
The image is uploaded and saved according to the options specified.
The uploaded image can be used in all template files now using a variable called $menu_image:

<?php
drupal_set_message
('<pre>' . print_r($menu_image, TRUE) . '</pre>');
?>

OR if you are using the developer module
<?php
kpr
($menu_image);
?>

To use the image anywhere in your template file:

<?php
if ($menu_image['enable']) {
  print
theme_image($menu_image['path'], $menu_image['descr'], $menu_image['descr']);
}
?>

Credits

Current maintainer:

* Amin Alid (Anolim GmbH) - http://drupal.org/user/139023
* Prodosh Banerjee (Anolim GmbH) - http://drupal.org/user/150260

This project has been sponsored by: Anolim GmbH (http://anolim.com)
Anolim provides consulting, technology and design for social media, ecommerce as well as web and mobile application development.

Similar projects

Menu Icons (http://drupal.org/project/menu_icons)
Header image (http://drupal.org/project/headerimage)

Maintainers for Menu Image

  • aminalid - 7 commits
    last: 1 year ago, first: 1 year ago

Issues for Menu Image

To avoid duplicates, please search before submitting a new issue.
All issues
Bug reports
nobody click here