A lot of menus allow menu elements to be ordered, but only on a per element basis.
I think an ordering by language would be a great advantage.
As an example, if I want the following alphabetic order in English:
Apples, Lemons, Pears
It wouldn't work for German. We can only hard code the order of each element without regard to the language, meaning that "Lemons" stays in second place, even though in German it would need to swap places with "Pears":
Äpfel (Apples), Zitronen (Lemons), Birnen (Pears)
We used the following code as a semi fix for an alphabetical ordering of the elements in the iqitmegamenu:
$sorttitles = array();
foreach($tabs AS $tabkey => $tabrow) {
if ($tabrow['position'] == 1) {
$sorttitles[$tabkey] = 'AAAA'; // Force first tab on
first position (HOME button!)
} else {
$sorttitles[$tabkey] = strreplace(array('ä', 'ö',
'ü', 'ß'), array('a', 'o', 'u', 's'), mbstrtolower($tabrow['title']));
}
}
arraymultisort($sorttitles, SORTASC, $tabs);
Perhaps it's useful for some other menu modules, too.
Question
30knees
A lot of menus allow menu elements to be ordered, but only on a per element basis.
I think an ordering by language would be a great advantage.
As an example, if I want the following alphabetic order in English:
Apples, Lemons, Pears
It wouldn't work for German. We can only hard code the order of each element without regard to the language, meaning that "Lemons" stays in second place, even though in German it would need to swap places with "Pears":
Äpfel (Apples), Zitronen (Lemons), Birnen (Pears)
We used the following code as a semi fix for an alphabetical ordering of the elements in the iqitmegamenu:
$sorttitles = array(); foreach($tabs AS $tabkey => $tabrow) { if ($tabrow['position'] == 1) { $sorttitles[$tabkey] = 'AAAA'; // Force first tab on first position (HOME button!) } else { $sorttitles[$tabkey] = strreplace(array('ä', 'ö', 'ü', 'ß'), array('a', 'o', 'u', 's'), mbstrtolower($tabrow['title'])); } } arraymultisort($sorttitles, SORTASC, $tabs);
Perhaps it's useful for some other menu modules, too.
Link to comment
Share on other sites
0 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now