Generate urls in the language select dropdown

General questions regarding the use of languages in Joomla! 3.x.

Moderators: infograf768, General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Post Reply
jun3on
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Thu Apr 11, 2019 8:40 am

Generate urls in the language select dropdown

Post by jun3on » Thu Apr 11, 2019 9:01 am

Hi all,

I have a question and reviewing the forum posts I could not find a solution.

My version of joomla is 3.9.1 and when we use the language selector in its "dropdown selector" mode I have noticed that different languages ​​do not generate an url but rather they go through an array and when you click you go to the language in question, with the consequent loss of SEO positioning since the home is not generating the links to the languages.

Example of selector with flags and links:

Code: Select all

<ul class = "lang-inline" dir = "ltr">
	<li class = "lang-active">
		<a href="http://www.someweb.com/">
		<img src = "/ media / mod_languages ​​/ images / en.gif" alt = "ES" title = "ES">
		</a>
	</ li>
	<li>
		<a href="/en/">
		<img src = "/ media / mod_languages ​​/ images / en.gif" alt = "EN" title = "EN">
		</a>
	</ li>
</ ul>
Example of a drop-down selector without flags and with language codes (ES, EN):

Code: Select all

<div class = "chzn-drop">
	<div class = "chzn-search">
		<input type = "text" autocomplete = "off" readonly = "">
	</ div>
	<ul class = "chzn-results">
		<li class = "active-result result-selected highlighted" data-option-array-index = "0" style = ""> ES
		</ li>
		<li class = "active-result" data-option-array-index = "1" style = ""> EN 
		</ li>
</ div>
There is some way that the "li" in the second case (drop-down without flags and with language codes) contain the links as in the first case.

Greetings and thanks in advance

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 18856
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: Generate urls in the language select dropdown

Post by infograf768 » Thu Apr 11, 2019 9:23 am

1. You should update to 3.9.5
2. It looks like you do not use the default core Language Switcher

This is what we get when using it on Protostar
Screen Shot 2019-04-11 at 11.17.54.png
You do not have the required permissions to view the files attached to this post.
Jean-Marie Simonet / infograf · http://www.info-graf.fr
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

jun3on
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Thu Apr 11, 2019 8:40 am

Re: Generate urls in the language select dropdown

Post by jun3on » Thu Apr 11, 2019 11:49 am

Hi infograf768,

Thanks for answer.

I just updated joomla to 3.9.5, and when I switch to protostar template still happens the same. The selector is only showing links when I use flags.

:(

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 18856
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: Generate urls in the language select dropdown

Post by infograf768 » Fri Apr 12, 2019 8:52 am

When using dropdown and not using flags, we have
Screen Shot 2019-04-12 at 10.45.12.png
Source will show

Code: Select all

</div><div class="well  switcherclass"><h3 class="page-header">Language Switcher</h3><div class="mod-languages switcherclass">

	<form name="lang" method="post" action="http://localhost:8888/installmulti/trunkgitnew/en/">
	<select class="inputbox advancedSelect" onchange="document.location.replace(this.value);" >
			<option dir="ltr" value="/installmulti/trunkgitnew/id/" >
		Bahasa Indonesia</option>
			<option dir="ltr" value="/installmulti/trunkgitnew/fr/" >
		Français</option>
			<option dir="ltr" value="/installmulti/trunkgitnew/en/" selected="selected">
		English (United Kingdom)</option>
			<option dir="ltr" value="/installmulti/trunkgitnew/it/" >
		Italiano (Italia)</option>
		</select>
	</form>

</div>
The links are present but do not show when hovering the language chosen.
It is perfectly OK.
You do not have the required permissions to view the files attached to this post.
Jean-Marie Simonet / infograf · http://www.info-graf.fr
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group


Post Reply

Return to “Language - Joomla! 3.x”