Post by Acate » Mon Sep 06, 2010 9:36 pm

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)

Newbie

Posts

Joined
Thu Sep 02, 2010 9:00 pm

Post by Acate » Fri Sep 10, 2010 2:56 am

no one?

Newbie

Posts

Joined
Thu Sep 02, 2010 9:00 pm

Post by Acate » Wed Sep 22, 2010 8:13 pm

up

Newbie

Posts

Joined
Thu Sep 02, 2010 9:00 pm

Post by WhiteBirch » Wed Sep 22, 2010 8:42 pm

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.

WhiteBirch - Premium OpenCart Templates on ThemeForest
Skylight - Our first OpenCart 1.4.9.1 template!
Darkwood - Stylish new OpenCart 1.4.9.1 template!


User avatar
New member

Posts

Joined
Wed Sep 15, 2010 3:06 pm
Location - UK

Post by billyggla » Wed Sep 22, 2010 9:05 pm

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 } ?>

Active Member

Posts

Joined
Mon Sep 20, 2010 7:05 am

Post by iolo » Mon Sep 27, 2010 8:54 pm

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.

Newbie

Posts

Joined
Mon Sep 27, 2010 8:27 pm
Who is online

Users browsing this forum: No registered users and 20 guests