3

I want to display my custom flags images at the language switcher module. How can I replace the default flags of the module?

  • How did you manage to use .pngs instead of .gifs? i find no way of doing this. Nico. – user2263 Nov 25 '14 at 14:40
  • @user2263: Your comment was for Brian Peat's comment below my answer. For my side, when I tried to use png's, I wasn't successful and gave up quickly. It might be possible though- but never ever tried again. I am okay with using gif's. – FFrewin Aug 10 '15 at 11:22
4

Actually the language siwtcher module gets the flags images from the directory

/media/mod_languages/images

We can define which image should be used for each language, when creating/editing the Content Languages in Language Manager, through the Image Prefix selection.

According to the instructions that appear when hovering the field:

Prefix of the image file for this language when using the "Use image flags" Language Switcher basic option. Example: if 'en' is chosen, then the image shall be en.gif. Images and CSS for this module are in media/mod_languages/

What does this say?
That the Flags images should be in .gif format and uploaded in the mentioned directory.

There is no need to replace existing images as we can use any prefix we like for our flags.

The custom flags would be available in the Edit Content Language layout, and we can search for them by typing the prefix we gave them.

Screenshot attached:
enter image description here

  • To add to this, the images don't HAVE to be gifs. Here's a site I made that has custom flags that are PNG. On top of that I'm using retina.js and put the @2x images in there so on a retina machine their double the resolution. shoresofgrace.com/en – Brian Peat Aug 20 '14 at 1:53
  • @brian-peat How did you change from gif to png? – Patrick Keane Nov 10 '15 at 14:07
  • 1
    Aha, looks like I did an html override and change .jpg to .png in the default.php file. – Brian Peat Nov 12 '15 at 14:03
  • where is this default.php file located? – Alexandros Jan 19 '16 at 9:48
  • 1
    @Alexandros: I guess he meant the default.php of the languages switcher module. – FFrewin Jan 19 '16 at 9:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.