Page 1 of 2 12 LastLast
Results 1 to 10 of 15
  1. #1
    Join Date
    Apr 2008
    Location
    Montreal, Quebec, Canada
    Posts
    28
    Plugin Contributions
    0

    Default Display image according to the language

    Good afternoon!

    I'm looking for a way to link a image with a selected language .

    This background image is actualy displaying navigation menus, so I need it to display in the correct language!

    I've created the two images and called them

    topmenubg_english.gif
    topmenubg_french.gif



    My site works fine right now with the english image always showing, whether the language is english or french.

    the file current image used is topmenubg.gif


    I found mention of it in this file, but don't know what to do with this information


    /includes/templates/(CUSTOM-TEMPLATE)/css/colors.css

    #navMain { background-color: #FFFFFF; background-image: url('../images/topmenubg.gif'); background-repeat: no-repeat }



    Is there a way for me to program something like:

    If language is = english, ('../images/topmenubg_english.gif')
    else ('../images/topmenubg_french.gif')


    or sometime along those lines???

  2. #2
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Display image according to the language

    It's much easier. It's built into Zen Cart that a stylesheet called french_stylesheet.css will load automatically, but only when the site is displaying pages in French (works for other languages too).
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  3. #3
    Join Date
    Apr 2008
    Location
    Montreal, Quebec, Canada
    Posts
    28
    Plugin Contributions
    0

    Default Re: Display image according to the language

    really?!

    great!! that program never cease to amaze me

    ok so, would that new file (french_stylesheet.css) be in the same folder as the other css files?

    right now, I have:
    /includes/templates/(CUSTOM-TEMPLATE)/css/

    colors.css
    layout.css
    stylesheet.css
    print_stylesheet.css
    <-- french_stylesheet.css goes here?

    and should I ONLY write the line concerning my image in that css file? or do I need to copy-paste the english css and modify the line concerning my image?

  4. #4
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Display image according to the language

    Oui! oui, oui et non.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  5. #5
    Join Date
    Apr 2008
    Location
    Montreal, Quebec, Canada
    Posts
    28
    Plugin Contributions
    0

    Default Re: Display image according to the language

    haha

    non à quoi au juste?

    non to
    I ONLY write the line concerning my image

    or

    non to
    copy-paste the original css and modify the line for my image

    (btw, thanks a lot kuroi )

  6. #6
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Display image according to the language

    non to
    copy-paste the original css and modify the line for my image

    You only to to change the line the has the location of the image that you wish to vary by language.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  7. #7
    Join Date
    Apr 2008
    Location
    Montreal, Quebec, Canada
    Posts
    28
    Plugin Contributions
    0

    Default Re: Display image according to the language

    Many, many thanks!

    Have a great day

  8. #8
    Join Date
    Apr 2008
    Location
    Montreal, Quebec, Canada
    Posts
    28
    Plugin Contributions
    0

    Default Re: Display image according to the language

    It worked perflectly!

    I have another question, in the same track...

    I now have two different navbar image, one for each language of my site

    However, the "help-tip" is still only in english (what displays when you leave the cursor on a link for a second or two)

    I know that these "help-tips" are defined here:
    includes/templates/CUSTOM-TEMPLATE/common/tpl_main_page.php

    [I erase some of the code in the example below, just for clarity]
    <div id="navMain">
    <a href="index.php"> alt="Home"
    <a href="index.php?main_page=login"> alt="My Account"
    <a href="index.php?main_page=logoff"> alt="Log Out my account"
    <a href="index.php?main_page=shopping_cart"> alt="Shopping Cart"
    <a href="index.php?main_page=checkout_shipping"> alt="Checkout"

    I tried copying the tpl_main_page.php and renaming it french_tpl_main_page.php and modifying the line for the help-tips but it doesnt work

    Is there a way to do this?!
    (I could live without but since the other question was so easily answered, I figured it would be stupid not to ask! )

  9. #9
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Display image according to the language

    If you have anything even closely resembling that in your tpl_main_page.php file, then I'm not surprised that it's not doing what it's supposed to.

    That code has a long list of problems and clearly couldn't work, but I have no way of knowing which are problems on your site, and which you have introduced by editing the code before posting it here, so it would be a waste of time for me to prepare more detailed comments on it.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  10. #10
    Join Date
    Apr 2008
    Location
    Montreal, Quebec, Canada
    Posts
    28
    Plugin Contributions
    0

    Default Re: Display image according to the language

    I fear that I didn't explain too clearly..

    I simply meant to show what help-tips I was talking about..

    "Home Page"
    "My Account"
    "Log Out my account"
    "Shopping Cart"
    "Checkout Now"

    The actual code that I have in
    includes/templates/CUSTOM-TEMPLATE/common/tpl_main_page.php

    is

    Code:
    <div id="navMain">
    <a href="index.php">
    <img src="includes/templates/S12_Mountain/images/spacer.gif" alt="Home Page" width="96" height="44" border="0" /></a>
    <a href="index.php?main_page=login">
    <img src="includes/templates/S12_Mountain/images/spacer.gif" alt="My Account" width="114" height="44" border="0" /></a>
    <a href="index.php?main_page=logoff">
    <img src="includes/templates/S12_Mountain/images/spacer.gif" alt="Log Out of My Account" width="89" height="44" border="0" /></a>
    <a href="index.php?main_page=shopping_cart">
    <img src="includes/templates/S12_Mountain/images/spacer.gif" alt="Shopping Cart" width="131" height="44" border="0" /></a>
    <a href="index.php?main_page=checkout_shipping">
    <img src="includes/templates/S12_Mountain/images/spacer.gif" alt="Checkout Now" width="106" height="44" border="0" /></a>
    </div>
    The result I aiming at is to have an english tpl_main_page.php (as shown above)
    and a french tpl_main_page.php, with the help-tips being:

    "Acceuil"
    "Mon Compte"
    "Log Out"
    "Mon Panier"
    "Acheter Maintenant"

    Sorry about the misunderstanding

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Banners display according to language
    By jadn79 in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 3 Jan 2012, 04:05 PM
  2. Replies: 0
    Last Post: 25 Sep 2010, 11:15 AM
  3. Flash banner according to language
    By littlehawk in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 4 Nov 2009, 04:36 AM
  4. different logo.gif according to language
    By stephane in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 23 Nov 2006, 06:26 PM

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