Page 1 of 1

Language flags not showing

Posted: Mon Jun 29, 2020 8:39 am
by a0394
Hi, i have both the language switcher plugin and module set to enabled, yet the language switcher flags don't appear in my top menu.
My website url:
https://verticalife.it/it

We used to have the flags enabled then a colleague disabled them, so i doubt it has to do with menu items and such, because we do have multiple languages installed and a default page for each one. I'll pm user data if requested for help.
Looking forward to your reply, best regards

Re: Language flags not showing

Posted: Mon Jun 29, 2020 2:54 pm
by mjparadac
Hello a0394

Are you using an extension to display the flags?

Regards,

Re: Language flags not showing

Posted: Tue Jun 30, 2020 9:31 am
by infograf768
Are you sure the language switcher module is enabled and set to an existing position in your template?

Re: Language flags not showing

Posted: Tue Jun 30, 2020 12:00 pm
by a0394
Hi, thanks for your replies! In the meantime i fidgeted some and finally made it.
Now i have another big question: we have 3 languages installed on our website, it-it, en-gb and en-us. However, the en-us language is being used for the USA branch of our brand, which has a different template and other changes. Is it possible to show only two of the languages' flags (it-it and en-gb)?
Looking forward to your reply, have a nice day!

Re: Language flags not showing

Posted: Thu Jul 02, 2020 8:49 am
by a0394
remove if not proper, but "up" lol

Re: Language flags not showing

Posted: Fri Jul 03, 2020 6:22 am
by infograf768
In the meantime i fidgeted some and finally made it.
Still can't find any switcher on your site.
Is it possible to show only two of the languages' flags (it-it and en-gb)?
You mean you do not want people to be able to switch to en-us?

Re: Language flags not showing

Posted: Fri Jul 03, 2020 12:49 pm
by a0394
I've enabled it only on this test page i'm working on:
https://verticalife.it/it/contatti-new
what i want to achieve is showing only the it-it and en-gb switches, thus hiding the en-us (which leads to our USA branch, which uses a different template)

Re: Language flags not showing

Posted: Sat Jul 04, 2020 7:23 am
by infograf768
That is easy.
Create an override for mod_languages and add $language->lang_code !== 'en-US' in the conditional.

In your case, as you use the list type I guess it would be line 75

Code: Select all

<?php if (!$language->active && $language->lang_code !== 'en-US') : ?>
or, if you display the active language line 89

Code: Select all

<?php elseif ($params->get('show_active', 1) && $language->lang_code !== 'en-US') : ?>

Re: Language flags not showing

Posted: Sat Jul 04, 2020 10:09 am
by a0394
Hi infograf768, thanks for your reply!
However, i'm not sure i got what you mean lol
Do you mean this: templates/MYTEMPLATE/html/mod_languages/default.php ?
And if there's no such line with that content, do i have to add it?

Re: Language flags not showing

Posted: Sun Jul 05, 2020 7:25 am
by infograf768

Code: Select all

Do you mean this: templates/MYTEMPLATE/html/mod_languages/default.php ?
Yes.

Code: Select all

And if there's no such line with that content, do i have to add it?
default.php in your template should be a copy of the core file.

Look at the lines I indicated and modify as suggested.

Re: Language flags not showing

Posted: Sun Jul 05, 2020 8:06 am
by a0394
Hi, yes i copied that file from the core to mytemplate/html/mod_languages(had to create the folder as well).
Yet i can't find any line like "<?php if (!$language->active && $language->lang_code !== 'en-US') : ?>" in it...

Re: Language flags not showing

Posted: Sun Jul 05, 2020 8:12 am
by infograf768
As I explained, you have to ADD the code $language->lang_code !== 'en-US' in the conditional

We have

Code: Select all

<?php if (!$language->active) : ?>
Change to

Code: Select all

<?php if (!$language->active && $language->lang_code !== 'en-US') : ?>

Re: Language flags not showing

Posted: Sun Jul 05, 2020 1:23 pm
by a0394
Ok i have changed line 75 according to your posts with "<?php if (!$language->active && $language->lang_code !== 'en-US') : ?>", but unfortunately the en-US flag is still there: https://verticalife.it/it/contatti-new

Re: Language flags not showing

Posted: Tue Jul 07, 2020 7:12 am
by infograf768
That is because it may not be that precise setting you use...
It could be the other line (89) as I already said above...

Code: Select all

<?php elseif ($params->get('show_active', 1) && $language->lang_code !== 'en-US') : ?>

Re: Language flags not showing

Posted: Tue Jul 07, 2020 8:20 am
by a0394
I also changed line 89 to

Code: Select all

<?php elseif ($params->get('show_active', 1) && $language->lang_code !== 'en-US') : ?>

but to no avail...

Re: Language flags not showing

Posted: Wed Jul 08, 2020 6:08 am
by infograf768
Can't help anymore without superuser access to your backend.