Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
JohnAlbinSorry for not responding sooner!