ZenphotoCMS Forum
Language selection with image buttons (help needed) - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: Language selection with image buttons (help needed) (/thread-5897.html)



Language selection with image buttons (help needed) - chross - 2009-09-30

Hi Folks,
from the search I saw that many people have the same request, like me, to habe a language switch option for the page that displays as buttons or images (maybe these cute little flags as seen on many sites). I modified the dynamic_locale plugin to do this for me, the code is as follows:
`

`
As you can see, the languages are hardcoded as images type buttons (could be done dynamically though, I've seen something similar in the forums).
The one caveat where I need your help is Internet Explorer 8's (and maybe all former versions as well) handling of these buttons: The image buttons submit the language as value for example value="en_US", but the Internet Explorer instead of the value submits the coordinates of the click on the image. This way, language won't change in IE but does well in Firefox.

Any suggestions to circumvent this problem?

Cheers,
chross




Language selection with image buttons (help needed) - acrylian - 2009-09-30

Try addressing the form directly with for exampledocument..submit() or look at the slideshow plugin's button, it uses js with a normal link to post a form. This seems to work fine with IE.




Language selection with image buttons (help needed) - chross - 2009-10-02

My solution (for now):

`
.language_button {width: 32px; min-width: 32px; height: 32px; min-height: 32px; overflow: hidden; border: none; font-size: 0px;}
.language_button:focus {outline: none; cursor:pointer; cursor:hand}
.language_button:hover {outline: none; cursor:pointer; cursor:hand}

dynamic-locale_de { background: transparent url(http://www.website.com/cms/media/flags/de.gif) no-repeat;}


dynamic-locale_en { background: transparent url(http://www.website.com/cms/media/flags/en.gif) no-repeat;}


`
I'm using this CSS to style regular input buttons. This is very well compatible in IE and FF.

This is the plugin code now:

`




Language selection with image buttons (help needed) - flu - 2009-10-02

Works for me too.
Thank you.