I am using GK ROYAl template and I don't find how to parameter template and modules to build both top horizontal menus as in Demo.
There is the following code within default.php in layout folder on line 107 and 123
"$this->mainmenu->loadMenu($this->API->get('menuname','mainmenu-left'));"
"$this->mainmenu->loadMenu($this->API->get('menuname','mainmenu-right'));"
This menu loading is conditionned by the following code
"if($this->API->get('show_menu', 1)"
I suppose both menu loading are active when template menu is enabled.
Variables "menuname, mainmenu-left, mainmenu-right are refering to what?
On my site enabling template menu doesn't change anything;
I created 3 module menus (for the 3 languages) and tried to add css menu classes from template.css without success.
menu modules are located in "masthead" position.
Any help is required to progress.
How to parameter left and right menus in GK Royal as in demo
- Edited
Sorry I found the solution.
Enabling template menu don't needs any menu modules.
But system menu name must be mainmenu-left and mainmenu-right
As my site is multilinguage (french, english , spanish), i certainly need the layout modification you propose in the forum.
To add the following lines code as the default language is french.
$lang = JFactory::getLanguage()->getTag();
$menuName = ($lang === 'fr-FR') ? 'mainmenu-left-fr' : 'mainmenu-left-en' : 'mainmenu-left-sp';
and
$lang = JFactory::getLanguage()->getTag();
$menuName = ($lang === 'fr-FR') ? 'mainmenu-right-fr' : 'mainmenu-right-en' : 'mainmenu-right-sp';
Correct?
Regards
Claude
Newbies in PHP.....
With 3 languages it was necessary to choose with an if coding
Following code in layout/default.php is working properly.
<div class="gkMainMenuWrap gkMainMenuLeft">
<?php if($this->API->get('menu_type', 'off-canvas') === 'classic') : ?>
<?php
$lang = JFactory::getLanguage()->getTag();
if ($lang === "fr-FR") {
$menuNameLeft = 'mainmenu-left-fr';
} elseif ($lang === "en-GB") {
$menuNameLeft = 'mainmenu-left-en';
} else {
$menuNameLeft = 'mainmenu-left-sp';
}
$this->mainmenu->loadMenu($this->API->get('menuname', $menuNameLeft));
$this->mainmenu->genMenu($this->API->get('startlevel', 0), $this->API->get('endlevel',-1));
?>
<?php endif; ?>
</div>
<?php endif; ?>
<div class="gkLogoWrap">
<?php $this->layout->loadBlock('logo'); ?>
</div>
<?php if($this->API->get('show_menu', 1) || $this->API->modules('search')) : ?>
<div class="gkMainMenuWrap gkMainMenuRight">
<?php if($this->API->get('show_menu', 1) && $this->API->get('menu_type', 'off-canvas') === 'classic') : ?>
<?php
$lang = JFactory::getLanguage()->getTag();
if ($lang === "fr-FR") {
$menuNameRight = 'mainmenu-right-fr';
} elseif ($lang === "en-GB") {
$menuNameRight = 'mainmenu-right-en';
} else {
$menuNameRight = 'mainmenu-right-sp';
}
$this->mainmenu->loadMenu($this->API->get('menuname', $menuNameRight));
$this->mainmenu->genMenu($this->API->get('startlevel', 0), $this->API->get('endlevel',-1));
?>
<?php endif; ?>