I needed the requirement for external links to open up in a new window.
Not sure how you go about coding patches etc so here's the code that does this:
theme_imagemenu_item()
Change this:
if (!empty($item['path'])) {
$output = '<li class="'. $li_class .'"'. $listyle .'><a href="'. url($item['path']) .'" class="'. $a_class .'"><img src="'.
base_path() . $item['imagepath'] .'" alt="'. check_plain($item['alt']) .'" title="'. check_plain($item['title'])
.'" name="imagemenu_'. $prefix .'_'. $item['mid'] .'"'. $script .' /></a>'. $menu .'</li>';
}
To this:
if (!empty($item['path'])) {
// adding option so that all external links open in a new window
$externalLink = '';
if(strpos(strtolower($item['path']), 'http') !== false) {
$externalLink = ' target="_blank" ';
}
$output = '<li class="'. $li_class .'"'. $listyle .'><a href="'. url($item['path']) .'" class="'. $a_class .'"'.$externalLink.'><img src="'.
base_path() . $item['imagepath'] .'" alt="'. check_plain($item['alt']) .'" title="'. check_plain($item['title'])
.'" name="imagemenu_'. $prefix .'_'. $item['mid'] .'"'. $script .' /></a>'. $menu .'</li>';
}
Comments
Comment #1
pobster commentedClosing as D6.x is now unsupported.