fbpx

Astroid 2.4 Landed with Joomla 4 Compatibility Download Now

Welcome, Guest
Username: Password: Remember me

TOPIC: Main Menu - Multilanguage

Main Menu - Multilanguage 1 year 9 months ago #10540

  • ozwest
  • ozwest's Avatar
  • Offline
  • Premium Member
  • Posts: 89
  • Thank you received: 2
  • Karma: 1
I am playing the the framework on a multi language site.
I am running into a problem because I can only set one Main Menu rather than referencing a module position so that the menu will swap out for different languages.
How would I do this?
The administrator has disabled public write access.

Main Menu - Multilanguage 1 year 9 months ago #10551

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Posts: 4145
  • Thank you received: 607
  • Karma: 108
Hello,

Since menu is part of the header, which is a core feature of the template and not a module position, It's kind of hard to keep have multiple headers on the same template.

The simplest way to accomplish this is using Template Styles. You copy the style (therefore duplicating what you have created), and assign the copied style to second language menu items and select the second menu as "Mega Menu" in header settings.

I hope the instructions above are clear.

Cheers,
Chetan
Thank You,
If you like our support and products, tweet us at joomdev and let the world know about it.
The administrator has disabled public write access.
The following user(s) said Thank You: ozwest

Main Menu - Multilanguage 1 year 9 months ago #10605

  • ozwest
  • ozwest's Avatar
  • Offline
  • Premium Member
  • Posts: 89
  • Thank you received: 2
  • Karma: 1
Thank you, I understand. However, is there a way that I could change the code so that I could choose the module position. I am making changes to the website often, so it is tedious to do that for several templates (copies). The use of just one would ensure consistency throughout.

On another note, I am using a custom css for the additional changes I do on the website. I understand this will keep them when there are updates. However what happens to the choices I made within the template, will they be transferred on update or do I need to write them all into the custom css?

I am looking to integrate the gradient field option which does change the files of the template. Will I have to do that every time and update is done?
The administrator has disabled public write access.

Main Menu - Multilanguage 1 year 6 months ago #13950

  • ozwest
  • ozwest's Avatar
  • Offline
  • Premium Member
  • Posts: 89
  • Thank you received: 2
  • Karma: 1
Hello Chandan
It looks like that I need create a second multi language website.
It would be just awesome if the assignment of the main menu could refer to a module position rather than a menu itself.
Is there a possibility for a hack?
Thank you
Last Edit: 1 year 6 months ago by ozwest.
The administrator has disabled public write access.

Main Menu - Multilanguage 1 year 6 months ago #13958

  • chandandeep
  • chandandeep's Avatar
  • Offline
  • Administrator
  • Posts: 3816
  • Thank you received: 584
  • Karma: 99
Hello,

Please explain with more details or examples. I am confused.

Thanks,
Chandan
Thank You,
If you like our support and products, tweet us at joomdev and let the world know about it.

To know more about products check out the their documentation.
The administrator has disabled public write access.

Main Menu - Multilanguage 1 year 6 months ago #13984

  • ozwest
  • ozwest's Avatar
  • Offline
  • Premium Member
  • Posts: 89
  • Thank you received: 2
  • Karma: 1


I would like to change the code here. I would like to reference to a module position rather than one specific menu.

Referencing a module position would allow me to publish different menus with different languages assigned and only menu with desired language would show when switching through the different languages on the website.

As it is, I would need to create two or more templates if I had more than 2 languages- identical and assign a menu for each language. This can become very messy if you have to maintain that website.

So, what I am looking for is where I could apply a hack in order to reference to a module position rather than a menu in the header section of the template.

Thank you
The administrator has disabled public write access.

Main Menu - Multilanguage 1 year 5 months ago #13992

  • nishtha
  • nishtha's Avatar
  • Offline
  • Moderator
  • Posts: 1386
  • Thank you received: 135
  • Karma: 17
Hi,

Well the hack you are asking for is not possible because duplicating the template for a multi language site is itself a hack and that's how it works.
So sorry to say but this cannot be done also because the functionality of the Main menu is dependent on the template only and not via module.

Thanks,
Nishtha
Thank You,
If you like our support and products, tweet us at joomdev and let the world know about it.

To know more about products check out the their documentation.
Last Edit: 1 year 5 months ago by nishtha.
The administrator has disabled public write access.

Main Menu - Multilanguage 1 year 5 months ago #13994

  • ozwest
  • ozwest's Avatar
  • Offline
  • Premium Member
  • Posts: 89
  • Thank you received: 2
  • Karma: 1
Hello Nishtha

I understand and I do NOT want to duplicate the template at all ... hence I am asking if I could maybe create a code override for that particular menu module you are asking the user to set in the template, so that I could reference the module position rather then the module (menu) itself.

Thank you
The administrator has disabled public write access.

Main Menu - Multilanguage 1 year 5 months ago #14027

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Posts: 4145
  • Thank you received: 607
  • Karma: 108
Hello,

Couple of things here, You can't change the Astroid backend to load module instead of menu name, since that will load a module position and what astroid needs is the name of the menu you want to load.
With that in mind, here are your options:
Modify the header layout based on Item(s) ID.
So, every menu item has a menu ItemId and you can use that menu item id to change the menu being loaded for the particular set of pages.
In file github.com/joomdev/Astroid-Framework/blo...eader/horizontal.php
Is where you need to pass the menu name Line 23 to be specific.
$header_menu = $params->get('header_menu', 'mainmenu');
and write something along the lines of.
$app = JFactory::getApplication();
$menu = $app->getMenu();
$active = $menu->getActive();
$itemId = $active->id;
if($Itemid == '111' || Itemid == '123') {
$header_menu = $params->get('mainmenu-en');
}elseif($Itemid == '159' || Itemid == '748') {
$header_menu = $params->get('mainmenu-fr');
}

So, in the above code what I am doing is loading mainmenu-en, if the ItemId's are 111 and 123 and load menu mainmenu-fr, If the itemId's are 159 and 748.

Make Sense?
Thanks,
Chetan
Thank You,
If you like our support and products, tweet us at joomdev and let the world know about it.
The administrator has disabled public write access.

Main Menu - Multilanguage 1 year 5 months ago #14073

  • ozwest
  • ozwest's Avatar
  • Offline
  • Premium Member
  • Posts: 89
  • Thank you received: 2
  • Karma: 1
Hello Chetan

I do have to get my head around this one ... I will come back to you.

Thank you
The administrator has disabled public write access.
Moderators: chandandeep
Time to create page: 0.457 seconds
Cron Job Starts