Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Join Date
    May 2009
    Posts
    1,219
    Plugin Contributions
    2

    Default different header based on language

    Hi,

    I have a slider in the header, and the images have text in them.
    Right now, regardless of the language selected by the user, the slider images are the same with the same text (language).

    I'd need the following
    user selects Italian language, hence the slider displays
    img_1_IT
    img_2_IT
    img_3_IT
    ...

    user selects English language, hence the slider displays
    img_1_EN
    img_2_EN
    img_3_EN
    ...

    ... and so on for additional languages

    I need to know how to implement an if/else statment to select the language, please note I have (and planning to add more) if/else for the slider (header) selection based on the page the user is on.

    v1.50
    amberprecious dot com
    different header (slider) at the "amber history" page (ez-page)

    Thank you

  2. #2
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: different header based on language

    There have been threads about displaying different banner ads for different languages, and a fairly simple method for doing it, which may be adaptable for you.
    Try searching for "banner group language"...

  3. #3
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: different header based on language

    multi lingual banners has a lot of info.

    You would identify the per-language images by the database language id, not by letters, in the image filename. Otherwise you should be able to do what you want.
    Last edited by gjh42; 20 Mar 2012 at 04:26 AM.

  4. #4
    Join Date
    Sep 2006
    Posts
    542
    Plugin Contributions
    0

    Default Re: different header based on language

    place your image in your languages/language/images

    with the same names

    ie. image1.gif
    image2.gif


    The link for language images are

    <?php echo zen_image(DIR_WS_LANGUAGES . 'images/' . $_SESSION['language'] . '/' . 'image1.gif', 'Your alt & title text for image here')?>
    ~~~~~~~~~~~~~~~~~~~~~~~~~~

    Play with it long enough and you will break it.

  5. #5
    Join Date
    May 2009
    Posts
    1,219
    Plugin Contributions
    2

    Default Re: different header based on language

    Thank you for the prompt replies, and apologies for the late follow-up.

    Glenn I had found exactly that thread based on your first suggestion, and I was trying to understand how to apply it to my case.
    Unfortunatelly somthing came up, and I'll get back to it in a couple days (see above).

    Meanwhile I see usernamenone's suggestion, which maybe based on that, I'll try it, and let you know ... in couple days, hopefully. ;)

  6. #6
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: different header based on language

    Usernameone's suggestion should actually do the job exactly right (aside from correcting the folder sequence).

    <?php echo zen_image(DIR_WS_LANGUAGES . $_SESSION['language'] . '/images/' . 'image1.gif', 'Your alt & title text for image here')?>

  7. #7
    Join Date
    Sep 2006
    Posts
    542
    Plugin Contributions
    0

    Default Re: different header based on language

    Quote Originally Posted by gjh42 View Post
    Usernameone's suggestion should actually do the job exactly right (aside from correcting the folder sequence).

    The sequence is correct.

    in red is the language of your choice ie english spanish or whatever.

    languages/language/images
    ~~~~~~~~~~~~~~~~~~~~~~~~~~

    Play with it long enough and you will break it.

  8. #8
    Join Date
    May 2009
    Posts
    1,219
    Plugin Contributions
    2

    Default Re: different header based on language

    Quote Originally Posted by usernamenone View Post
    <?php echo zen_image(DIR_WS_LANGUAGES . 'images/' . $_SESSION['language'] . '/' . 'image1.gif', 'Your alt & title text for image here')?>
    Quote Originally Posted by gjh42 View Post
    <?php echo zen_image(DIR_WS_LANGUAGES . $_SESSION['language'] . '/images/' . 'image1.gif', 'Your alt & title text for image here')?>
    Quote Originally Posted by usernamenone View Post
    languages/language/images
    I think Glenn was referring to where the images folder was in your first post (in magenta), which you confirm in your second.

    Anyhow I can't do it till couple days, I'll let you know.

    And thank you both for the assistance.

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

    Default Re: different header based on language

    My language link in correct and works just the way it is wrote.

    However, if Glenn prefers his code it works also.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~

    Play with it long enough and you will break it.

  10. #10
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: different header based on language

    In a fresh v1.5.0, there is an /includes/languages/english/images/, but no /includes/languages/images/english/ (as the zen_image() code in post 4 would give). I was just giving a heads up so someone wouldn't unknowingly copy the wrong code.
    Last edited by gjh42; 22 Mar 2012 at 04:49 AM.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v153 Different Prices Based on Different Payment Methods
    By jokkah in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 24 Aug 2014, 12:49 PM
  2. v151 synchronise header format for different language pages
    By CSFB in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 26 Nov 2012, 04:04 AM
  3. I need an add-on for display different language by different ip address?
    By hunterwater1234 in forum Addon Language Packs
    Replies: 12
    Last Post: 8 Dec 2008, 12:10 AM
  4. Different Header based on landing page...one database
    By forced in forum Templates, Stylesheets, Page Layout
    Replies: 9
    Last Post: 12 Dec 2007, 07:20 PM
  5. Different Header for different Language?
    By Goshawk in forum General Questions
    Replies: 5
    Last Post: 10 Sep 2007, 10:28 AM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR