0
Welcome Guest! Login
0 items Join Now

SOLVED Can "CUSTOM HTML" contain a language selector?

    • Robert's Avatar
    • Robert
    • Newbie
    • Posts: 18
    • Thanks: 0

    SOLVED Can "CUSTOM HTML" contain a language selector?

    Posted 8 years 1 month ago
    • I use Custom HTML in the "MENU EDITOR".

      The "MENU EDITOR" does not have a language setting.
      The Joomla Menu does have a language setting.

      Is there any way that i can use a HTML trick like:
      <html>
      (if language= ENG) Hello
      (if language= FRA) Bonjour
      </html>

      Update:
      Would this javascript select the language?
      stackoverflow.com/questions/15255735/how...-website-using-javas
      <script type="text/javascript">
      var language_code = "<?php echo $lang_code;?>";
      var language_name = "<?php echo $lang_name ;?>";
      console.log("Lang Code"+language_code+"Lang Name"+language_name);
      </script>
    • Last Edit: 8 years 1 month ago by Robert.
    • MrT's Avatar
    • MrT
    • Preeminent Rocketeer
    • Posts: 101084
    • Thanks: 13481
    • Web Designer/Developer

    Re: SOLVED Can "CUSTOM HTML" contain a language selector?

    Posted 8 years 1 month ago
    • Use a language constant and then create overrides for the lanaguage constant in language manager. Look at Joomla docs for how to use language constants. Alternately create two versions of the module for each language and assign the module to the correct langauge then Joomla will choose to use the correct one based upon the current language.

      Regards, Mark.
    • The following users have thanked you: Robert

    • Please search forums before posting. Please make sure your post includes the version of the CMS you are using and a link to the problem. Annotations on screenshots can also be helpful to explain problems/goals. Please use the "secure" tab for confidential information.
    • Robert's Avatar
    • Robert
    • Newbie
    • Posts: 18
    • Thanks: 0

    Re: SOLVED Can "CUSTOM HTML" contain a language selector?

    Posted 8 years 1 month ago
    • Excellent thanks for giving the 2 options.
      I just put 2 custom modules in the menu (using the menu editor) and indeed it selects the correct one.
      The language constant looks more appropriate, but how to insert it in my custom HTML? I created the COM_CONTENT_RELATED constant value. But I'll RTFM on that.... ;)
      Thanks for helping this beginner on a far far away mountain top.
    • MrT's Avatar
    • MrT
    • Preeminent Rocketeer
    • Posts: 101084
    • Thanks: 13481
    • Web Designer/Developer

    Re: SOLVED Can "CUSTOM HTML" contain a language selector?

    Posted 8 years 1 month ago
    • See "custom language strings" http://jure-stern.si/blog/custom-language-overrides-with-joomla-language-manager/

      Is your issue now solved? If so, please EDIT your FIRST POST in this thread by adding [SOLVED] at the start of the title and then select the TICK icon. This lets the moderators know that it can be moved to the solved section.


      Regards, Mark.
    • The following users have thanked you: Robert

    • Please search forums before posting. Please make sure your post includes the version of the CMS you are using and a link to the problem. Annotations on screenshots can also be helpful to explain problems/goals. Please use the "secure" tab for confidential information.
    • Robert's Avatar
    • Robert
    • Newbie
    • Posts: 18
    • Thanks: 0

    Re: SOLVED Can "CUSTOM HTML" contain a language selector?

    Posted 8 years 1 month ago
    • Ok I found the solution using the sorcerer plugin and then I can just drop this in a CUSTOM HTML
      {source}<?php echo JText::_('Custom_String'); ?>{/source}

Time to create page: 0.051 seconds