Advertisement

Wrong menu association between languages

General questions regarding the use of languages in Joomla! 5.x.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Post Reply
NetRod2
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Sat Dec 07, 2024 8:09 pm

Wrong menu association between languages

Post by NetRod2 » Sat Dec 07, 2024 8:24 pm

Hi all.

I'm creating a multilingual website. I've the following menus in Language A:
  • Menu 1
  • Menu 2
  • --- Menu 2.1
  • --- Menu 2.2
  • Menu 3
and in Language B:
  • Menu 1
  • Menu 2
  • Menu 3
because there are a few things that haven't been translated into Language B.

Now, when I'm browsing the Language A website, either menu 2, 2.1 or 2.2, and I switch to Language B (using the language switcher module), I'm correctly redirected to its Menu 2 page.

But, when browsing Menu 2 in Language B and selecting Language A, I'm taken to the page for Menu 2.1 instead of Menu 2. I've checked many times that the language associations are correct. I don't know why Joomla does this.

Advertisement
User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 31514
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: Wrong menu association between languages

Post by Per Yngve Berg » Sun Dec 08, 2024 12:00 am

What Item Type is Menu2?

NetRod2
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Sat Dec 07, 2024 8:09 pm

Re: Wrong menu association between languages

Post by NetRod2 » Sun Dec 08, 2024 11:09 am

Per Yngve Berg wrote: Sun Dec 08, 2024 12:00 am What Item Type is Menu2?
It's a Category List type menu (in both languages).

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 31514
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: Wrong menu association between languages

Post by Per Yngve Berg » Mon Dec 09, 2024 2:05 pm

There is a one-to-many relationship. I guess Menu 2.1 is the first one to turn up in the list.

NetRod2
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Sat Dec 07, 2024 8:09 pm

Re: Wrong menu association between languages

Post by NetRod2 » Mon Dec 09, 2024 9:03 pm

But, how could that be? Menus 2.1 and 2.2 are not associated with any other menu, that field is empty. On the other hand, Menu 2 in Language A is associated with Menu 2 in Language B (and vice versa).

Also, Menu 2 has a lower ID than 2.1 and 2.2, so I think it should be retrieved first. The ordering seems right too.

I've also checked the categories, and the articles. Everything seems to be alright. Quite puzzling.

NetRod2
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Sat Dec 07, 2024 8:09 pm

Re: Wrong menu association between languages

Post by NetRod2 » Thu Dec 12, 2024 9:10 pm

Well, I solved it. Kind of.

Turns out Joomla does not actually use language associations to "connect" menu items with each other. It's strange but it seems to use the item type and target category. Both menus 2 and 2.1 where displaying the same category (the difference is that 2.1 wasn't showing subcategories). When I tested creating a new category and changing menu 2.1 to show that one, the problem went away.

Advertisement

Post Reply

Return to “Language - Joomla! 5.x”