Hi,
The problem is that the function used for splitting the menu title into two parts is
str_word_count which is not utf-8 compliant.
I have created a modification that uses multibyte functions to split the title. Works great under FF,IE,Chrome and Safari.
All you need to do is modify the file (create backup first):
\templates\it_spotlight\html\mod_mainmenu\helper.php
and replace this block (in _getItemData function):
| Code: |
/*--------------------------------------------------------------------------- added to split the menu name into first word and the rest */
$var = str_word_count($item->name, 1);
$firstword = ($var[0]);
$restofname = "";
$i = 1;
while (!empty($var[$i])) :
$restofname .= " ".$var[$i];
$i++;
endwhile;
$tmp->name = "";
if (!empty($restofname)){
$tmp->name .= '<span><![CDATA['.$firstword.']]></span>';
$tmp->name .= '<span class="sub">'.$restofname.'</span>';
}
else
$tmp->name = '<span><![CDATA['.$item->name.']]></span>';
/*--------------------------------------------------------------------------- end of new code */
|
To this block:
| Code: |
/*----- added to split the menu name into first word and the rest */
//UTF-8 support for main menu titles modified by Marton Feovenyessy (feovenyessy@gmail.com)
$tmp_tomb = mb_ereg('[\w]+[\s|\.|\?|\!|[0-9]]+',$item->name,$regs);
$eredmeny_hossz=mb_strlen($regs[0]);
$focim=($eredmeny_hossz>0)?$regs[0]:$item->name;
$focim_hossz=mb_strlen($focim);
$teljes_hossz=mb_strlen($item->name);
$alcim_hossz=$teljes_hossz-$focim_hossz;
$alcim=($teljes_hossz>$focim_hossz)?mb_substr($item->name,$focim_hossz,$alcim_hossz,'utf-8'):"";
$tmp->name = "";
if (!empty($alcim)) {
$tmp->name .= '<span><![CDATA['.$focim.']]></span>';
$tmp->name .= '<span class="sub">' . $alcim . '</span>';
}
else
$tmp->name = '<span><![CDATA['.$item->name.']]></span>';
/*--------------------------------------------------------------------------- end of new code */
|
And voilá, you're good to go.
http://rapidshare.com/files/202776143/helper.php.zip.html