PDA

Zobacz pełną wersję : ikonki graficzne w menu mainmenu



panorama
20-07-2006, 23:34
Witam! Chciałbym dodać ładne, małe ikonki w menu mainmenu na lewym brzegu przed tekstem kazdego odnosnika w tym menu, tak jak jest to obecnie w portalu http://www.yahoo.com/. (zobaczcie koniecznie!) Czy da się to zrobić i w jaki sposób?
Pozdrawiam.

Rybik
21-07-2006, 00:24
1. moduly witryny znajdz modul menu wlacz w parametrach obsluge ikon
2. edytuj linka menu i przypisz mu ikone

jezeli z jakiegos powodu nie ma w parametrach linka opcji na wybor grafiki tylko pole tekstowe (np link do komponentu joomlaboard tak ma) to nalezy w to pole wpisac:
menu_image=grafika.gif , bez cudzyslowia, a plik grafika.gif musi byc w images/stories/

Rybik
21-07-2006, 01:19
modyfikacja wkladajaca obrazek wewnatrz linka
/modules/mod_mainmenu.php
kod oryginalny


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;


zamienic na:


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' ) ) {
$image_right = '&nbsp;'. $image;
$image_left = '';
} else {
$image_right = '';
$image_left = $image . '&nbsp;';
}
}
}
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;


zmiana polega na tym ze sekcja if, ktora kiedys doklejala obrazek do tekstu linka po jego utworzeniu teraz generuje obrazek lewy i prawy (jeden pusty), ktory potem jest wklejany wewnatrz linka

panorama
21-07-2006, 14:25
Mam ponownie. Mam jeszcze jedno pytanie. Otóż zaistalowałem komponent i mod lxmenu. Czy jeśli zastosuje te zmiany w modzie mainmenu, to będą one równiez widoczne dla lxmenu. W tej tej chwili wyswietlam własnie lxmenu. Czy tez musze na nowo włączyć mainmenu, a wyłączyć lxmenu?

Michael_23
22-07-2006, 23:17
Jeżeli Twój problem polega teraz na kliknięciu (włączyć/wyłączyć) to może sam spróbujesz.
Po to stworzono takie CMS-y jak Joomla! by laicy od PHP mogli bezboleśnie eksperymentować,
zawsze przeciez można cofnąć ustawienia.

:)