Menus - ordering elements per language



  • 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:

    $sort_titles = array();
    foreach($tabs AS $tabkey => $tabrow) {
    if ($tabrow[‘position’] == 1) {
    $sort_titles[$tabkey] = ‘AAAA’; // Force first tab on
    first position (HOME button!)
    } else {
    $sort_titles[$tabkey] = str_replace(array(‘ä’, ‘ö’,
    ‘ü’, ‘ß’), array(‘a’, ‘o’, ‘u’, ‘s’), mb_strtolower($tabrow[‘title’]));
    }
    }
    array_multisort($sort_titles, SORT_ASC, $tabs);

    Perhaps it’s useful for some other menu modules, too.


Log in to reply
 

Looks like your connection to thirty bees forum was lost, please wait while we try to reconnect.