It´s great this thing that you have done!
Well I make some changes. This changes allows you to have a Menu only with Images, a Menu with text and images and a menu only with text; all at the same time.
In
mod_mainmenu.php its the same that you already publish with a little change (in red)
PHP Code:
$txt = '<a href="'. $mitem->link .'" class="'. $menuclass .'" '. $id .'>';
//-------------------------------------------------------------------------------------
//Main Menu Image Hack by Sajid Saiyed of //http://www.ssdesigninteractive.com/g2
//-------------------------------------------------------------------------------------
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.= $image;
} else {
$txt .= $image .' '. $txt;
}
}
}
//-------------------------------------------------------------------------------------
//Main Menu Image Hack end
//-------------------------------------------------------------------------------------
if ( $params->get( 'just_images' ) == '0' ) { /// CHANGE
$txt.= $mitem->name;
}
$txt.='</a>';
break;
}
AND you also add at the end, BELOW
$params->def( 'menu_images', 0 );
You put:
$params->def( 'just_images', 0 );
Then in mod_mainmenu.xml
Below
<param name="menu_images" type="radio" default="0" label="Show Menu Icons" description="">
<option value="0">No</option>
<option value="1">Yes</option>
</param>
You ADD
<param name="just_images" type="radio" default="0" label="Show Type Menu Images" description="">
<option value="0">No</option>
<option value="1">Yes</option>
</param>
So... in Modules->Site Modules->mainmenu
You will have an extra option: "Show Type Menu Images"
So when you want a menu only with text, you select NO in option "Show Menu Icons" and "Show Type Menu Images"
When you want a menu with text and an image, you select YES in option "Show Menu Icons" and NO in option "Show Type Menu Images"
And last, when you want a menu only with an image, you select YES in option "Show Menu Icons" and "Show Type Menu Images"
REMEMBER: if you have to select an image for each option in the menu.
