0
Welcome Guest! Login
0 items Join Now

SOLVED Language dependent menu

  • SOLVED Language dependent menu

    Posted 16 years 11 months ago
    • Hi all,

      I am using JoomFish with RT simplix template. though this question is not RT simplix based, it would be suitable for 99% of RT templates. What I am trying to accomplish is to have dependent menus for separate languages (I.e. Dutch and English).

      I found a perfect solution at Joomfish.net for that: www.joomfish.net/how-to-.../-how-to-use-...u-items-/-menus.html

      Though this is based on having the menus in a true working module position. As far as I know, RT templates (99%) do not make use of module positions for the menus showing, as a part of the index.php from RT Simplix willl show. It makes use of the menuname, not the module position.
      $default_style = "style10";           //[style1... style10]
      $layout_style = "B";                              // A | B
      $enable_rokzoom = "true";              // true | false
      $template_width = "950";                    // width in px | fluid
      $menu_name = "mainmenu";                    // mainmenu by default, can be any Joomla menu name
      $menu_type = "moomenu";                     // moomenu | suckerfish | splitmenu | module
      $default_font = "default";      // smaller | default | larger
      $show_pathway = "true";                     // true | false

      The basics of the multi languaged menus is this:

      mainmenu_en
      mainmenu_nl

      You will notice the _language name.

      The following I tried to put in the RT template, but that is not working:
      $menu_name = "mainmenu_<?php echo strtolower($mosConfig_lang);?>";  

      But that is not working.

      Does anyone have a clue how I could set the mainmenu_languagename to work through the regular index.php of RT templates.. It should be something similar... but I am not a programmer.

      The purpose why is because I want to show some menu items in English, that i do not want to show in the Dutch menu. Normally JoomFish works fine in RT templates for just translating ALL menu items, this is specifically about showing different mainmenus for each language.

      Thanks!
    • Last Edit: 16 years 11 months ago by Piet Nutbey.
    • Best regards,

      Piet Nutbey

      Joomla Video Tutorials: www.joomtorial.com
    • Nick_'s Avatar
    • Nick_
    • Jr. Rocketeer
    • Posts: 32
    • Thanks: 0

    Re: SOLVED Language dependent menu

    Posted 16 years 11 months ago
    • Unfortunately i do not have an answer to that, but may have a simple suugestion to that. As I understand your users will click on language (flag) thumbnail to get to content in different languages? Right. Why not just copy the whole website, and then load all the items in the other langauge, so when user click on language thumb he will be redirected to the homepage of the other clone site? It could be fast an simple, since anyway you need to create all the other language menu and content items...

      I have found some codes in Joomla forum which may give ideas to people who know some more about php and joomla compare to my limited knowledge. Here they are:

      <?php if ( $my->id ) { echo '<a href="index.php?option=com_login&Itemid=262">Logout</a>'; } else { echo '<a href="index.php?option=com_login&Itemid=262">Login</a>'; }; ?>

      That was used to have a simple link to be replaced based on the login status. I tried to modify it for my purpose, but was not able too, just because I dont know much about php, and where to paste the code like that (tryed index.php file - did nt do any good)

      The other code I saw to be used for changing modules loaded to the same position depend on the same login status look like this:

      <?php if ( $my->id ) { mosLoadModules ( 'regmenu' );} else { mosLoadModules ( 'guestmenu' ); } ?>

      However if you know your php and write something like:

      <?php if ( $my->id ) { mosLoadModules ( 'mainmenu_en' );} else { mosLoadModules ( 'maimenu_dt' ); } ?>

      and chage login parameters for people using diferent languages it may work? .. maybe?

      In anyway.. I thought those codes can give you some ideas :)
    • Last Edit: 16 years 11 months ago by Nick_.
    • Thanks,
      Nick Borisenco
      SoftLauncher.com
      This email address is being protected from spambots. You need JavaScript enabled to view it. (please, make a subject line - Joomla Work Request)
      [Joomla based business websites, eCommerce web portals, custom graphic design work]
  • Re: SOLVED Language dependent menu

    Posted 16 years 11 months ago
    • Hi,

      Thank you for the reply.

      To have a duplicate website for a few menu items is a bit inconvenient. The JoomFish I use for 2 laguages is perfect.

      The php codes you wrote are again based on modules. Joomla RT themes do not use the module positions. They use $menu_name="menuname". I had found those solutions, but they are not useful for RT templates.

      Thank you so much for the time you took in replying!
    • Best regards,

      Piet Nutbey

      Joomla Video Tutorials: www.joomtorial.com
    • faisool's Avatar
    • faisool
    • Hero Rocketeer
    • Posts: 422
    • Thanks: 0

    Re: SOLVED Language dependent menu

    Posted 16 years 11 months ago
    • im interested in finding an answer to this question ..
  • Re: SOLVED Language dependent menu

    Posted 16 years 11 months ago
  • Re: SOLVED Language dependent menu

    Posted 16 years 11 months ago
    • Hi all,

      Let me try and rephrase the request:

      I think what it basically should need for the RT menu is an "if else" statement that should do the following. Since I can't program I do not know how to setup the if else statement other than in real language. Though I hope someone could translate that to proper working code.

      It should be something like the following.
      If language is Dutch then the menu is Dutch
       
      Else the menu is English

      Hopefully someone is able to translate in real code.
    • Best regards,

      Piet Nutbey

      Joomla Video Tutorials: www.joomtorial.com
  • Re: SOLVED Language dependent menu

    Posted 16 years 11 months ago
    • Hi,

      Earlier I wrote this question had to have a very simple answer. Perhaps real programmers have a fair chance that it has become too hard to think simple.

      5 minutes ago I decided to scavenge some index.php files to see if i could find a basic if - else statement which I could use to try and program myself.

      5 minutes later I got the thing working.

      It is so simple and I would like to share this with others that might look for a similar solution.

      The original code of a RocketTheme template is as follows:
      $default_style = "style10"; //[style1... style10]
      $layout_style = "B";               // A | B
      $enable_rokzoom = "true";    // true | false
      $template_width = "950";     // width in px | fluid
      $menu_name = "mainmenu";     // mainmenu by default, can be any Joomla menu name
      $menu_type = "moomenu"; // moomenu | suckerfish | splitmenu | module
      $default_font = "default";&nbsp; &nbsp; &nbsp; // smaller | default | larger
      $show_pathway = "true";      // true | false

      I got the language dependent menu working by creating 2 extra menus for each language (basically your mainmenu can be dropped, the JoomFish multi language module has no further use and can be uninstalled - no need for that!) and then make the RocketTheme index.php as follows:
      $default_style = "style10"; //[style1... style10]
      $layout_style = "B";               // A | B
      $enable_rokzoom = "true";    // true | false
      $template_width = "950";     // width in px | fluid
      $menu_type = "moomenu"; // moomenu | suckerfish | splitmenu | module
      $default_font = "default";&nbsp; &nbsp; &nbsp; // smaller | default | larger
      $show_pathway = "true";      // true | false
       
      if( $mosConfig_lang != "english" ) { 
      $menu_name = "mainmenu_nl";
      } else {
      $menu_name = "mainmenu_en";
      }

      Look at the original RocketTheme lines and notice in my lines I also erased the line $menu_name = "mainmenu";

      I hope this is helpful for others. It is working on my own (2 languages) website. Mind you! This is not an automated JoomFish solution (but as far as I could tell, neither is the Multi Language JoomFish module - http://www.joomfish.net/how-to-.../-how-to-use-language-dependent-menu-items-/-menus.html ).

      I now have a setup where I can show menu-items in RT themes in 1 language which I don't want to show in another language.

      Good luck!

      With best regards,

      Piet Nutbey
      The Netherlands
    • Last Edit: 16 years 11 months ago by Piet Nutbey.
    • Best regards,

      Piet Nutbey

      Joomla Video Tutorials: www.joomtorial.com
    • Zorro's Avatar
    • Zorro
    • Sr. Rocketeer
    • Posts: 114
    • Thanks: 0

    Re: SOLVED Language dependent menu

    Posted 16 years 9 months ago
    • Piet,

      you are a genius. This will probably solve the problem I'm currently facing.

      Thanks very much for your solution, I'll give it a go.

      Kind regards,
      Zorro
  • Re: SOLVED Language dependent menu

    Posted 13 years 11 months ago
    • this can work with Gantry ?
  • Re: SOLVED Language dependent menu

    Posted 13 years 11 months ago
    • Hi,

      As far as I can see, nope.
    • Best regards,

      Piet Nutbey

      Joomla Video Tutorials: www.joomtorial.com

Time to create page: 0.071 seconds