Cant add second language to the main menu
January 2013 Joomla Template
Rate this topic: 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!
-
- 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
to
There should be 2 menues:
- homemenuen
- homemenuru
("en" and "ru" are language codes, first 2 chars)
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)
-
- Fresh Boarder
2 posts
• Page 1 of 1