#3486 - Language specific menu ordering
| Identifier | #3486 |
|---|---|
| Issue type | Trivial issue (does not break functionality) |
| Title | Language specific menu ordering |
| Status | Closed (rejected) |
| Handling member | Chris Graham |
| Addon | core_menus |
| Description | Just translated some menu strings in French and German, organised them alphabetically but if you change the order in 1 language the order is changed for all. Would be handy if the order was saved against the language somehow :) |
| Steps to reproduce | |
| Funded? | No |
The system will post a comment when this issue is modified (e.g., status changes). To be notified of this, click "Enable comment notifications".


Comments
You could create different menus however, and use Tempcode to show the menu based on language. Or you could drop down to the level of HTML in templates and just implement multiple of them by hand in HTML.
diff --git a/sources/menus.php b/sources/menus.php
index a335b92e6..36bc12b55 100644
--- a/sources/menus.php
+++ b/sources/menus.php
@@ -648,6 +648,8 @@ function _render_menu_branch($branch, $codename, $source_member, $level, $type,
$new_children = array();
$expand_this = false;
if (isset($branch['children'])) {
+ if ($branch['title']->evaluate() == 'Content') sort_maps_by($branch['children'], 'title');
+
foreach ($branch['children'] as $child) {
list($children2, $_expand_this) = _render_menu_branch($child, $codename, $source_member, $level + 1, $type, $as_admin, $all_branches, $apply_highlighting, $the_level + 1);
if ($_expand_this) {
That's making the menu of title 'Content' sort it's children.
I don't want to add an official feature to do this, but it's a simple change to the code.