Fork me on GitHub

language buttons in header (I know how not to do it) ;-)  Bottom

  • Hi,
    I use BlankTheme and have added to two language buttons in the header of my theme
    http://micware.nl/zikula
    I used the following code

    Code

    <div class="language">
    <a href="http://micware.nl/zikula/index.php?newlang=eng"><img alt="English" title="English" src="images/flags/flag-eng.png"/></a>
    <a href="http://micware.nl/zikula/index.php?newlang=nld"><img alt="Nederlands" title="Nederlands" src="images/flags/flag-nld.png"/></a>
    </div>


    I’m not a real programmer and the way I did it has some disadvantages



      Das Anybody has a better solution for this , I look on the forum, but there not many threads about this subject

      Thx
      Michiel
    • I'm not a real programmer and the way I did it has some disadvantages

      - When I press the button I return to the home page
      - The absolute location is hardcoded in the theme
      - I have to place the code in every template
      - The languages are hardcoded in the theme
    • I still haven't use BlankTheme [hiding for Mateo and Espaan] but only two templates are needed no?
      master and home.htm

      You can use

      Code

      <a href="<!--[pngetcurrenturl]-->&newlang=eng" title="English"><img src="images/flags/flag-eng.png" alt="English" /></a>


      not sure if the base URL will be present, otherwise add before pngetbaseurl

      and for hardcoded stuff, I always use

      Code

      <!--[pnusergetlang assign=currentlang]-->
      <!--[if $currentlang == "eng"]-->Hey, look English
      <!--[else]--> Jaja, dit is Nederlands... sjieke dinges é
      <!--[/if]-->


      - Igor
    • Hi Igor,
      The worked, better then my solution.
      thx for that.

    This list is based on users active over the last 60 minutes.