PDA

Zobacz pełną wersję : Atywne ikony w menu



maron69
08-02-2007, 01:33
Witam.

Korzystam z szablonu "madeyourweb" i mam menu z 2 stron.
W jednym menu dodałem ikony ale trochę to głupio wygląda kiedy tekst jest aktywny(odsyła do innych stron) a ikona(np. z logiem tej strony) nie. Co trzeba zrobić żeby każda ikona była podlinkowana??
Proszę o pomoc:)
Pozdrawiam.

stone
08-02-2007, 08:32
Musiałbyś pogrzebać w kodzie modules/mod_mainmenu i dodać linkowanie do obrazków ( o ile cię dobrze zrozumiałem:))

maron69
08-02-2007, 09:34
Tak, dobrze.
Ale nie mam pomysłu jak to zrobić, tak że jeśli dodam nową pozycje w menu to następna ikonka tez będzie aktywna.:/

Rybik
08-02-2007, 11:04
/modules/mod_mainmenu.php od linii ok 88 ma być:


switch ($mitem->browserNav) {
// cases are slightly different
case 1:
// open in a new window
$txt = '<a href="'. $mitem->link .'" target="_blank" class="'. $menuclass .'" '. $id .'>'. $image_left . $mitem->name . $image_right .'</a>';
break;
case 2:
// open in a popup window
$txt = "<a href=\"#\" onclick=\"javascript: window.open('". $mitem->link ."', '', 'toolbar=no,location=no,status=no,menubar=no,scrol lbars=yes,resizable=yes,width=780,height=550'); return false\" class=\"$menuclass\" ". $id .">". $image_left . $mitem->name . $image_right ."</a>\n";
break;
case 3:
// don't link it
$txt = '<span class="'. $menuclass .'" '. $id .'>'. $image_left . $mitem->name . $image_right .'</span>';
break;
default: // formerly case 2
// open in parent window
$txt = '<a href="'. $mitem->link .'" class="'. $menuclass .'" '. $id .'>'. $image_left . $mitem->name . $image_right .'</a>';
break;
}
return $txt;
}
/**
* Vertically Indented Menu
*/

maron69
08-02-2007, 22:42
Wiem, że truje, ale próbowałem wstawić ten kod i wywalało mi błąd próbowałem też rozkminić to na kilka sposobów ale nic nie działa, bo albo ikony nie działają, albo całkowicie znikają:confused::confused:
Tak wygląda orginalny kod od lin. 72 do 110

switch ($mitem->browserNav) {
// cases are slightly different
case 1:
// open in a new window
$txt = '<a href="'. $mitem->link .'" target="_blank" class="'. $menuclass .'" '. $id .'>'. $mitem->name .'</a>';
break;

case 2:
// open in a popup window
$txt = "<a href=\"#\" onclick=\"javascript: window.open('". $mitem->link ."', '', 'toolbar=no,location=no,status=no,menubar=no,scrol lbars=yes,resizable=yes,width=780,height=550'); return false\" class=\"$menuclass\" ". $id .">". $mitem->name ."</a>\n";
break;

case 3:
// don't link it
$txt = '<span class="'. $menuclass .'" '. $id .'>'. $mitem->name .'</span>';
break;

default: // formerly case 2
// open in parent window
$txt = '<a href="'. $mitem->link .'" class="'. $menuclass .'" '. $id .'>'. $mitem->name .'</a>';
break;
}

if ( $params->get( 'menu_images' ) ) {
$menu_params = new stdClass();
$menu_params = new mosParameters( $mitem->params );
$menu_image = $menu_params->def( 'menu_image', -1 );
if ( ( $menu_image != '-1' ) && $menu_image ) {
$image = '<img src="'. $mosConfig_live_site .'/images/stories/'. $menu_image .'" border="0" alt="'. $mitem->name .'"/>';
if ( $params->get( 'menu_images_align' ) ) {
$txt = $txt .' '. $image;
} else {
$txt = $image .' '. $txt;
}
}
}

return $txt;
}(Podmieniłem ta częsć od 72 do 93)
Sorki jeszcze raz, że tak męcze ale nie mam się do kogo zwrócić:(