Page 1 of 1

Change header image when language changes

Posted: Mon Sep 06, 2010 9:36 pm
by Acate
is it possibile to change header image when user changes language?

e.g. header is.

Image



when user clicks on spanish language, header image becomes another one with text in spanish (e.g comunidad)

Re: Change header image when language changes

Posted: Fri Sep 10, 2010 2:56 am
by Acate
no one?

Re: Change header image when language changes

Posted: Wed Sep 22, 2010 8:13 pm
by Acate
up

Re: Change header image when language changes

Posted: Wed Sep 22, 2010 8:42 pm
by WhiteBirch
I'm not sure if this would work without looking into it, but I beleive you can have HTML tags in the language definitions. So maybe you could create a new line in the header language files and then call upon it in the template in place of the normal code. If that makes sense? There's probably a better way.

Re: Change header image when language changes

Posted: Wed Sep 22, 2010 9:05 pm
by billyggla
you could use an if statment in the header to call another stylesheet.

something like

Code: Select all

<?php if ($language['code'] == $language_code) { ?>
<link rel="stylesheet" type="text/css" href="catalog/view/theme/<?php echo $template; ?>/stylesheet/stylesheet.css" />
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="catalog/view/theme/default/stylesheet/ie6.css" />
<?php } else { ?>
<link rel="stylesheet" type="text/css" href="catalog/view/theme/<?php echo $template; ?>/stylesheet/stylesheet2.css" />
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="catalog/view/theme/default/stylesheet/ie6.css" />
<?php } ?>

Re: Change header image when language changes

Posted: Mon Sep 27, 2010 8:54 pm
by iolo
I'm new to opencart but would a combination of javascript and php do the trick? Maybe something along the lines of:

Code: Select all

document.getElementById('header').style.backgroundImage="url(path/to/backgroundimage<? $language['code']; ?>.jpg)"
Then all you need is an image for each language with the language code in the name in your theme file.