Page 1 of 2 12 LastLast
Results 1 to 10 of 15
  1. #1
    Join Date
    May 2005
    Posts
    51
    Plugin Contributions
    0

    Default Two languages - two templates. Can this be done?

    Hi

    I create my custom template, in Greek language, in which I have images, custom meny etc. I edit the file tpl_header.php located in my custom template folder:

    includes\templates\my_template\common

    Now I would like to have different header with english images, english custom menu etc. so when somene click on english flag, he can see this different header. How this can be done?

    Regards, Zoran

  2. #2
    Join Date
    May 2005
    Posts
    51
    Plugin Contributions
    0

    Default Re: Two languages - two templates. Can this be done?

    Never Mind, I found it

    In case that some one else need the solution here it is:

    Edit tpl_header.php located in your custom template folder:

    includes\templates\my_template\common



    <?php
    $language = $_GET['language'];

    if ( $language == 'el' ) {
    ?>
    Your HTML table with menu in one language meny here

    <?php

    } else {
    ?>

    Your HTML with ENGLISH language meny and images here


    <?php
    }
    ?>

    Regards, Zoran

  3. #3
    Join Date
    Apr 2004
    Location
    UK
    Posts
    5,821
    Plugin Contributions
    2

    Default Re: Two languages - two templates. Can this be done?

    Good tip.. thanks for sharing

  4. #4
    Join Date
    May 2005
    Posts
    51
    Plugin Contributions
    0

    Default Re: Two languages - two templates. Can this be done?

    Solution mentioned above doesn't work as it should. Since the query &language=en is not passed on all pages, I am loosing my second language navigation on next page.

    Can this variable be stored in session?

    Regards, Zoreli

  5. #5
    Join Date
    Apr 2006
    Location
    Sofia, Bulgaria
    Posts
    203
    Plugin Contributions
    0

    Default Re: Two languages - two templates. Can this be done?

    hmm
    u can see the code in sideboxes/languages.php
    and move it into header !!!
    Negative feelings were burned by the progressive increase of Euphoria

  6. #6
    Join Date
    May 2005
    Posts
    51
    Plugin Contributions
    0

    Default Re: Two languages - two templates. Can this be done?

    Didnt find anything useful inside.

    I have to found how other links on the page know which language is used. Because only my custom links are loosing the language, while other (text) links works normaly.

    Good try anyway.

    Thanks, Zoreli

  7. #7
    Join Date
    May 2005
    Posts
    51
    Plugin Contributions
    0

    Default Re: Two languages - two templates. Can this be done?

    Solution was:
    $language = $_SESSION['language'];

    I had EN in my code and

    $_SESSION['language']; return 'english', not 'en'

    Now it works like a charm.

    Regards, Zoreli

  8. #8
    Join Date
    Apr 2006
    Location
    Sofia, Bulgaria
    Posts
    203
    Plugin Contributions
    0

    Default Re: Two languages - two templates. Can this be done?

    do this will work with English and other one (nevermind what language) ?>
    Negative feelings were burned by the progressive increase of Euphoria

  9. #9
    Join Date
    Apr 2006
    Location
    Sofia, Bulgaria
    Posts
    203
    Plugin Contributions
    0

    Default Re: Two languages - two templates. Can this be done?

    I dont know Why but it shows me a blank page i cant make it
    can give me the complete code couse not good in coding ?
    Negative feelings were burned by the progressive increase of Euphoria

  10. #10
    Join Date
    May 2005
    Posts
    51
    Plugin Contributions
    0

    Default Re: Two languages - two templates. Can this be done?

    Quote Originally Posted by sicness
    do this will work with English and other one (nevermind what language) ?>
    Yes

    Quote Originally Posted by sicness
    I dont know Why but it shows me a blank page i cant make it
    can give me the complete code couse not good in coding ?

    Edit tpl_header.php located in your custom template folder:

    includes\templates\my_template\common


    This is the only file that should be edited.

    You should add your html meny in tpl_header.php. Did you do this and you are getting blank page?

    Regards, Zoreli

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v138a How can i have two languages using the sermepa payment module?
    By zand in forum Addon Payment Modules
    Replies: 1
    Last Post: 13 Jun 2012, 11:56 PM
  2. Two domains for two different languages
    By fosmaster in forum General Questions
    Replies: 2
    Last Post: 19 Oct 2010, 11:03 AM
  3. Two Different Header two languages
    By PaulaSinner in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 21 Mar 2009, 10:04 PM
  4. Almost done just one or two questions - how to make my page look like this?
    By tag in forum Templates, Stylesheets, Page Layout
    Replies: 26
    Last Post: 24 Jan 2007, 06:48 AM
  5. Zones on two languages ?
    By sicness in forum General Questions
    Replies: 0
    Last Post: 19 Jul 2006, 02:39 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg