mainmenu mod position not showing up as option

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
Fri Apr 19, 2013 3:16 am
Reply with quote
Report this post
i would like to use a third party menu - mainmenu does not show up as a mod position option in joomla admin for simplicity
User avatar
Junior Boarder

GK User
Fri Apr 19, 2013 4:42 am
Reply with quote
Report this post
Main menu position is using GK Menu and it is hard coded in files.
If you want to edit the code following is what you need.

Find file: /templates/gk_simplicity/layouts/default.php
Find Lines: 57 to 76 which is responsible for main menu as well as mobile menu.
Code: Select all
             <?php if($this->API->get('show_menu', 1)) : ?>
             <div id="gkMainMenu">
                <?php
                   $this->mainmenu->loadMenu($this->API->get('menu_name','mainmenu'));
                    $this->mainmenu->genMenu($this->API->get('startlevel', 0), $this->API->get('endlevel',-1));
                ?>   
             </div>
             <?php endif; ?>
            
             <?php if($this->API->get('show_menu', 1)) : ?>
             <div id="gkMobileMenu">
                <?php echo JText::_('TPL_GK_LANG_MOBILE_MENU'); ?>
                <select onChange="window.location.href=this.value;">
                <?php
                    $this->mobilemenu->loadMenu($this->API->get('menu_name','mainmenu'));
                    $this->mobilemenu->genMenu($this->API->get('startlevel', 0), $this->API->get('endlevel',-1));
                ?>
                </select>
             </div>
             <?php endif; ?>

You can delete above and replace with your module or leave them as it is and add your new position just after it such as below. In below example I have used "mynewmenu" as position name.
Code: Select all
            <?php if($this->API->modules('mynewmenu')) : ?>
            <div id="gkMainMenu">
               <jdoc:include type="modules" name="mynewmenu" style="<?php echo $this->module_styles['mynewmenu']; ?>" />
            </div>
            <?php endif; ?>


Now above will catch any module positions using "mynewmenu" as position. Now you need to show this position to be selectable from module settings page. Alternatively you can just type the module position manually in module settings page.

Find file: /templates/gk_simplicity/templateDetails.xml
Find Line: 76 & 77 which is below.
Code: Select all
      <!-- Template specific Module Positions -->
      <position>breadcrumb</position>

Add your new position after it.
Code: Select all
      <!-- Template specific Module Positions -->
      <position>breadcrumb</position>
      <position>mynewmenu</position>
      <position>header</position>

Now new position should be selectable in module settings page.

You might need to adjust css style to suit your needs depending on which menu you are using as my example is using default gkMainMenu div css styling. Change its name or add your own css.
Code: Select all
<div id="gkMainMenu">
</div>


If you haven't deleted original menu codes then please disable Main Menu in
Template settings > Options > Menu > Show template menu " Disabled".

See you around...
User avatar
Platinum Boarder

GK User
Fri Apr 19, 2013 10:31 am
Reply with quote
Report this post
I am considering another menu as the gavick menu is not working - you can view it at
http://65.60.53.10/~iloveca/
User avatar
Junior Boarder

GK User
Fri Apr 19, 2013 1:06 pm
Reply with quote
Report this post
If you haven't made any modifications can you please re-upload latest template overwriting all previous template files.

Let us know how you get on, see you around...
User avatar
Platinum Boarder

GK User
Fri Apr 19, 2013 7:55 pm
Reply with quote
Report this post
I have uploaded the files and now my site does not work
User avatar
Junior Boarder

GK User
Fri Apr 19, 2013 7:58 pm
Reply with quote
Report this post
Please send an admin access and ftp details to my email normanuk[at]live.co.uk and I ll take a look.

Please include this topic link in your email.

See you around...
User avatar
Platinum Boarder

GK User
Tue Aug 20, 2013 11:16 am
Reply with quote
Report this post
Hello. I have set up some languages in my site as shown here: http://www.reinterpreten.com

now as the menu is hardcoded i have to replace the hardcoded with for example:
<jdoc:include type="modules" name="position-7" />

but how can i get the menu style from the template to the new menu?

Thank you
User avatar
Junior Boarder

GK User
Tue Aug 20, 2013 12:35 pm
Reply with quote
Report this post
@reinterpret,

If you are only trying to get other language menus to show once language is selected in front-end than we can customize your template file to load language menus.

Let me know, see you around...
User avatar
Platinum Boarder

GK User
Tue Aug 20, 2013 1:03 pm
Reply with quote
Report this post
hm. would this cost something? the templates would be nicer if this would not be hardcoded because of language support. or is there another way to get the menu translated?

thank you. .
User avatar
Junior Boarder

GK User
Wed Aug 21, 2013 11:24 am
Reply with quote
Report this post
Of course if won't cost anything : )

You can modify your template file which is below.

File: template/gk_templatename/layouts/default.php
Code responsible for choosing menu name is below
Code: Select all
$this->mobilemenu->loadMenu($this->API->get('menu_name','mainmenu'));

There are 2 of these one for mobile and one for normal layout.
First it loads menu name in template settings if not it defaults to menu name "mainmenu".

Now there are 2 ways you can create multiple menus.
1. Copy template styles and in each styles template settings > menu options choose your menu or step 2
2. Edit above mentioned file and replace following lines, this is for mobile menu.
Code: Select all
                <?php if($this->API->get('show_menu', 1)) : ?>
                <div id="gkMobileMenu" class="gkPage"> <i class="icon-reorder"></i>
                        <select onChange="window.location.href=this.value;">
                                <?php
                   $this->mobilemenu->loadMenu($this->API->get('menu_name','mainmenu'));
                   $this->mobilemenu->genMenu($this->API->get('startlevel', 0), $this->API->get('endlevel',-1));
               ?>
                        </select>
                </div>
                <?php endif; ?>

Replace with below
Code: Select all
                <?php if($this->API->get('show_menu', 1)) : ?>
            <?php
            $lang = JFactory::getLanguage();
            $currentlang = substr($lang->getTag(), 0, 2);
            $newmenu = 'mainmenu-'. $currentlang;
            ?>
                <div id="gkMobileMenu" class="gkPage"> <i class="icon-reorder"></i>
                        <select onChange="window.location.href=this.value;">
                                <?php
                   $this->mobilemenu->loadMenu($newmenu);
                   $this->mobilemenu->genMenu($this->API->get('startlevel', 0), $this->API->get('endlevel',-1));
               ?>
                        </select>
                </div>
                <?php endif; ?>

Again following is for normal layout menu.
Code: Select all
                <?php if($this->API->get('show_menu', 1)) : ?>
                <div id="gkMainMenu" class="gkPage">
                        <?php
                   $this->mainmenu->loadMenu($this->API->get('menu_name','mainmenu'));
                    $this->mainmenu->genMenu($this->API->get('startlevel', 0), $this->API->get('endlevel',-1));
                ?>
                </div>
                <?php endif; ?>

Replace with below.
Code: Select all
                <?php if($this->API->get('show_menu', 1)) : ?>
                <div id="gkMainMenu" class="gkPage">
                        <?php
                   $this->mainmenu->loadMenu($newmenu);
                    $this->mainmenu->genMenu($this->API->get('startlevel', 0), $this->API->get('endlevel',-1));
                ?>
                </div>
                <?php endif; ?>

$newmenu variable will contain following: mainmenu- plus first part of your language code.
Now in your menu manager rename your mainmenu to mainmenu-en
Other menus should have first part of your language code such as below
mainmenu-fr
mainmenu-de
mainmenu-es
mainmenu-br
mainmenu-ru

Hope this helps. See you around...
User avatar
Platinum Boarder

GK User
Wed Aug 21, 2013 1:36 pm
Reply with quote
Report this post
great. thanks a lot! i ll try later. . .
User avatar
Junior Boarder

GK User
Tue Aug 27, 2013 10:18 am
Reply with quote
Report this post
No problem, let me know if you need further help.

Have a nice day.
User avatar
Platinum Boarder

GK User
Fri Dec 05, 2014 1:19 am
Reply with quote
Report this post
Hi Norman.

A query:
I tested this ( post: Wed Aug 21, 2013 10:24 am) with GK-University and works, but does not work with mobiles.
What modification could do to also work with mobiles ?

Pd. Sorry for my english
User avatar
Fresh Boarder

GK User
Sat Mar 26, 2016 11:24 pm
Reply with quote
Report this post
Excelent!! great work!
User avatar
Fresh Boarder


cron