Adding translatable text to the mobile menu?

Rate this topic: Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.
GK User
Sun May 17, 2015 3:46 pm
Reply with quote
Report this post
Hi,
I need to add only the word MENU before the icon in the Mobile menu. I can add it in the CSS but that way it wound be translatable.

How can I accomplish that?

Thanks,
Gorast
User avatar
Platinum Boarder

GK User
Sun May 17, 2015 4:28 pm
Reply with quote
Report this post
Hi,
If CSS method is not good , you have to edit template file and add some new lines of php with IF ...THEN...
as you probably know we cannot support customizations.
User avatar
Platinum Boarder

GK User
Sun May 17, 2015 9:43 pm
Reply with quote
Report this post
Hi Oscar,
I'm aware about the support yes.

Can you please tell me this:
- Is there a way to add translatable strings/fields in css?
- Which php file handles the mobile menu so I can mod it?

Thanks,
Gorast
User avatar
Platinum Boarder

GK User
Mon May 18, 2015 9:24 pm
Reply with quote
Report this post
In most cases : gk_news2\layouts\default.php
mobile menu code you will find with easily reading comments.

CSS - can not help you, because inside CSS you cannot add conditions (if..then) from php code.
User avatar
Platinum Boarder

GK User
Tue May 19, 2015 9:23 am
Reply with quote
Report this post
I did it. Just added <div id="mobileMenuString"><?php echo JText::_('MOBILE_MENU_STRING'); ?></div> in the default.php and I got what I need. Overrides works and translating is piece a caka :D

Thanks!
Gorast
User avatar
Platinum Boarder

GK User
Fri May 22, 2015 9:34 pm
Reply with quote
Report this post
If you want to help others ..you can share there your solution (code) here. thanks.
User avatar
Platinum Boarder

GK User
Fri May 22, 2015 9:53 pm
Reply with quote
Report this post
Sure, here it is.

Edit the file (TEMPLATE FOLDER)/layout/default.php

Find the gkMobileMenu ID and change the code with this one:

Code: Select all
<div id="gkMobileMenu">
               <div id="mobileMenuString"><?php echo JText::_('MOBILE_MENU_STRING'); ?></div>
               <i id="mobile-menu-toggler" class="fa fa-bars"></i>
                  <select id="mobileMenu" onChange="window.location.href=this.value;" class="chzn-done">
                   <?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>


Then in override.css or menu.css modify your look.

The translation string is MOBILE_MENU_STRING. You can do translations in Language/Overrides or in the appropriate language ini file.

Gorast
User avatar
Platinum Boarder


cron