Thread: Language flags
View Single Post
  #3  
Old 01-22-2008, 05:40 AM
 
Asiaplay Asiaplay is offline
 

X-Wizard
  
Join Date: Oct 2005
Posts: 1,242
 

Default Re: Language flags

Yes buddy - it is possible...

Use code in place of the drop-down box (delete the code that activates the drop down box)... and hard code it into the template instead.

In skin1/head.tpl

Find the following lines (and delete / replace them):-

<td><select name="sl" onchange="javascript: this.form.submit();">
{section name=ai loop=$all_languages}
<option value="{$all_languages[ai].code}"{if $store_language eq $all_languages[ai].code} selected="selected"{/if}>{$all_languages[ai].language}</option>
{/section}
</select></td>

Below is example of code which shows US Flag and German Flag... replace the deleted code above with this.
<td>
<a href="home.php?sl=US" title="{$lng.lbl_text_for_flag_us_alt}"><img src="{$Images}/folder_name_you_put_flags_into/flag_US.gif" border="0" width="24" height="16" alt="{$lng.lbl_text_for_flag_us_alt}" /> <a href="home.php?sl=DE" title="{$lng.lbl_text_for_flag_de_alt}"><img src="{$Images}/folder_name_you_put_flags_into/flag_DE.gif" border="0" width="24" height="16" alt="{$lng.lbl_text_for_flag_de_alt}" />
</td>

Then put a GIF photo file called "flag_US.gif" and one called "flag_DE.gif" into your images folder i.e. "Images/folder_name_you_put_flags_into/" (e.g. Images/flags/)
If you want alt text to appear, then under X-Cart Admin languages, add the language tag "lbl_text_for_flag_us_alt" and put in the text you want to appear (e.g. "USA - click here to change to USA English).

Note that this was a flag for USA English and Germany (German) - to make one for another language, change all the US and DE seen above to ES (Spanish) or FR (France) etc. - you can keep adding to the code to add more flags.

Hope this helps - cheers, Asiaplay
__________________
X-Cart Gold version 4.1.9
(plus built in X-Cart bugs!)
Reply With Quote