Cant add second language to the main menu

January 2013 Joomla Template
Rate this topic: Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.1.00 out of 6 based on 1 vote(s)
GK User
Mon Feb 22, 2016 4:50 pm
Reply with quote
Report this post
Hi! I've successfully added 2 languages to my site, create 2 additional menues and localized all the modules. I've used this article in the process https://www.gavick.com/documentation/jo ... joomla-1-7. The last thing to do is to localize the side menu. How can I do that? I can either add simple menu as a block (works great, but I want side menu as in the template), or change menu in the template settings to the localized one. Thanks for your help!
User avatar
Fresh Boarder

GK User
Mon Feb 22, 2016 6:11 pm
Reply with quote
Report this post
I've found the solution, may be it will help others.
You have to modify layouts\default.php, change

Code: Select all
$this->asidemenu->loadMenu($this->API->get('menu_name','mainmenu'));


to

Code: Select all
$lang = JFactory::getLanguage();
$currentlang = substr($lang->getTag(), 0, 2);
$this->asidemenu->loadMenu('homemenu'. $currentlang);


There should be 2 menues:
- homemenuen
- homemenuru
("en" and "ru" are language codes, first 2 chars)
User avatar
Fresh Boarder


cron
Remember me
Register New Account
If you are old Gavick user, click HERE for steps to retrieve your account.