Hi

Im currently doing this with the default menu using this code

function basic_three_col_links__system_main_menu($data) {
  // Allows for images as menu items. Just supply the path to the image as the title
  foreach($data['links'] as $name=>$link) {
    if (strpos($link['title'], '.png') !== false || strpos($link['title'], '.jpg') !== false || strpos($link['title'], '.gif') !== false || strpos($link['title'], '.svg') !== false) {

    $variables = array(
      'path' => $link['title'],
      'alt' => $link['attributes']['title'],
      'title' => $link['attributes']['title'],
      'attributes' => array('class' => 'main-menu-image', 'id' => $name . '-image'),
    );
    $link['title'] = $img = theme('image', $variables);
    $link['html'] = TRUE;  //otherwise theme_link will use check_plain on the title
    }
  $data['links'][$name]=$link;
  }
  return theme('links', $data);
}

and need to know how I can do this using block menu

thanks

Comments

JohnAlbin’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

Sorry for not responding sooner!