can any one help me to add images to primary menus in drupal6
Thanks.

Comments

swapnaj’s picture

helpme plz

RobNL’s picture

Well, if nobody wants to help swapnaj ;-) then help me! I'm facing the same challenge. I want to use images (three of the images states: not choosen, choosen and mouse-over) in stead of the text links in the primary menu. Furthermore I want to control the exact location. I started with the pixture_reloaded theme which I've converted into something else. The development site is currently located on euax.org.

mattgilbert’s picture

would also like help with this. at least with adding unique ids to primary links (in a zen subtheme) so perhaps i can pull it off with css.

i've seen many requests for help with this, but i haven't found a solution for drupal 6 in a zen subtheme.

mattgilbert’s picture

Found this to be a way to give every menu link a unique id, which can then be styled with css. (Using the desired image as a background image.) Would rather just add the id to primary links, and give a more logical numbering system, but this works. Apply css styles with identifiers such as "#menu-link-176" and "#menu-link-176:hover".

Add this to your theme's template.php, switching "theme" with the name of your theme.

function theme_menu_item_link($link) {
  if (empty($link['localized_options'])) {
    $link['localized_options'] = array();
  }
  $link['localized_options']['attributes']['id'] = 'menu-link-'.$link['mlid'];
  
  return l($link['title'], $link['href'], $link['localized_options']);
}

Not too familiar with jQuery or I would try that.

ytokan’s picture

Hi,
i use Jquery for dynamically replace title of link. I identify my primary menu and then replace element with Image.

By
Yto