Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2006
    Posts
    9
    Plugin Contributions
    0

    Idea or Suggestion Customizing header......

    HI everybody ! I hope tha you can understand me, because my english is bad !
    I have one question, i dont know is that is possible, i have 2 header ( spanish-english) it is diferent about zencart, in ( includes/template/template_defautl/common/tpl_header.php
    i did add in the first line (includes"myheader_es.php") of tpl_header.php,
    ok for now all work ok. my own header and zencart, but i dont know how can i do for when the user cick in the language (flag) my header change too, because I dont know how can include 2 header (english-spanish) for respective language
    when the user clik in your language the zencart change but my header dont. Wao ! I hope tha you can understand me
    for example : this page (forum). if i includes in the first line this: includes"myheader_es.php" the look will be diferent without touch the code of this forum, do you understand me I hope tha someone can help me,
    have nice day everybody

  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: Customizing header......

    The tpl_header.php file is mainly just for the layout of the header and not the content text. This file I would think would be the same for both languages.

    Where you want to include differences is in the includes/languages/english/header.php file & the english.php file then in the includes/languages/other_language/header.php file & other_language.php file.

    This way when the language is changed ZenCart will load the alternative language files text but still lay it out as defined by the single tpl_header.php file.

    And I hope that you can understand my response.
    Zen-Venom Get Bitten

  3. #3
    Join Date
    Sep 2006
    Posts
    9
    Plugin Contributions
    0

    Default Re: Customizing header......

    Quote Originally Posted by kobra View Post
    The tpl_header.php file is mainly just for the layout of the header and not the content text. This file I would think would be the same for both languages.

    Where you want to include differences is in the includes/languages/english/header.php file & the english.php file then in the includes/languages/other_language/header.php file & other_language.php file.

    This way when the language is changed ZenCart will load the alternative language files text but still lay it out as defined by the single tpl_header.php file.

    And I hope that you can understand my response.

    Sorry, until now I see it your answers, I have been very busy. thanks you, I understand you perfectly…

  4. #4
    Join Date
    Aug 2007
    Location
    Eugene, OR
    Posts
    162
    Plugin Contributions
    0

    Default Re: Customizing header......

    Here's a twist on the above question which I can not seem to figure out:

    I actually want to have two different tpl_header.php files depending on which language is selected by the visitor. I do not simply want to change the pictures (which I already know how to do), but I actually want the links and other header layout to be different.

    I tried putting two language folders in the templates/mytemplate/common/ folder, but that did not seem to work (I was trying to copy the way the multi-language buttons are done).

    Any ideas on this?

  5. #5
    Join Date
    Aug 2007
    Location
    Eugene, OR
    Posts
    162
    Plugin Contributions
    0

    Default Re: Customizing header......

    OK, I learned from another post that I can not do it this way. Dr Byte recommended adding some code to tpl_header.php in the form of an "if" statement based on the language being used. So I tested the following, and it worked:

    <?php
    if ($_SESSION['language'] == 'schinese')
    {
    echo "hellohellohello";
    }
    else
    {
    echo "monkeymonkey";
    }
    ?>

    So now I will add the links and layout that I want for the Chinese visitors into the code above instead of the line "echo "hellohellohello";" and I will add the links and layout that I want for English language visitors instead of the line "echo "monkeymonkey";"

 

 

Similar Threads

  1. customizing the header
    By oxman in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 26 Nov 2011, 06:30 AM
  2. Customizing Header
    By neergnai in forum General Questions
    Replies: 5
    Last Post: 13 Nov 2008, 04:24 AM

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