User tests: Successful: Unsuccessful:
This patch adds a new link
tag in the head
section with hreflang
attribute set to x-default
.
head
tag). There should be a link
tag with hreflang
attribute with x-default
value and the href
should point to the same content in the language that you selected in "x-default language" field.None that i know of.
For language/country selectors or auto-redirecting homepages, you should add an annotation for the hreflang value "x-default" as well:
Source: https://support.google.com/webmasters/answer/189077?hl=en
Status | New | ⇒ | Pending |
Labels |
Added:
?
|
I understand the instructions above as using as a new alternate with x-default a chosen language whether using URL Language code or not.
Ok, you think it should be active whether "Remove URL Language Code" is set to "Yes" or "No".
If i do that, when "Remove URL Language Code" is set to "Yes" it will overwrite the site default language hreflang (ex: en-GB).
That language could be the site default language per default, but I guess it should be chosen by the site maintainer, i.e. would need a new parameter in the plugin.
I guess you are saying put a parameter to choose the x-default language in language plugin.
I'm no expert in Joomla. But what i understand is:
If i'm correct, i don't see the need for another parameter in the plugin. But i could be missing something.
Will try to precise the way I see it:
x-default alternate is a parameter that lets Google define for SEO purposes a certain url as the url displaying stuff specifically aimed at user who would not be specially redirected to one of the possible languages (for example when Language Selection for new Visitors is set to Browser settings on their browsers.)
It is NOT a redirection per se. It is just used to crawl contents. It does not overrides other alternates, it ADDS to the existing alternates and can be the same url as one of the alternates.
Whether this Content Language is the default site language or not, the user should decide.
Example: I have a multilingual site where the default site language is French, I have also English (en-GB) and Spanish.
I may want the English language to be the x-default for Google but I still want the default site language OR the user's browser settings (or cache) to load the correct page.
In this case, when URL Language code is removed, it is the French language which corresponds to the pure scheme://domain.tld/
.
As I want English to be, for SEO crawling purposes, the x-default alternate, the url should include the url language code (en in my case) scheme://domain.tld/en/
if SEF is on.
If I choose French as my x-default, then it will be the pure scheme://domain.tld/
.
Therefore, we would need a new parameter to choose that language.
[The next question, which is really unclear on Google Webmaster, concerns adding the x-default for Home pages only or all pages.
Also, I am not totally sure it is necessary in Joomla multilingual case.]
As far as I understand, the x-default alternate link should always point to the site root, because this is the only URL from which Joomla! redirects to some language's home page depending on the settings (default or browser language detection), and the link can be added to all pages of the site.
x-default alternate is a parameter that lets Google define for SEO purposes a certain url as the url displaying stuff specifically aimed at user who would not be specially redirected to one of the possible languages (for example when Language Selection for new Visitors is set to Browser settings on their browsers.)
Yes, i know. x-default is only for crawlers for SEO purposes.
It is NOT a redirection per se. It is just used to crawl contents. It does not overrides other alternates, it ADDS to the existing alternates and can be the same url as one of the alternates.
When i has referring «it will overwrite the site default language hreflang (ex: en-GB)» i has referring to the function addHeadLink
(https://github.com/joomla/joomla-cms/blob/staging/libraries/joomla/document/html/html.php#L277-L284) that only allows one link tag per URI.
Whether this Content Language is the default site language or not, the user should decide.
Example: I have a multilingual site where the default site language is French, I have also English (en-GB) and Spanish.
I may want the English language to be the x-default for Google but I still want the default site language OR the user's browser settings (or cache) to load the correct page.
In this case, when URL Language code is removed, it is the French language which corresponds to the pure scheme://domain.tld/.
As I want English to be, for SEO crawling purposes, the x-default alternate, the url should include the url language code (en in my case) scheme://domain.tld/en/ if SEF is on.
If I choose French as my x-default, then it will be the pure scheme://domain.tld/.
Therefore, we would need a new parameter to choose that language.
Hum, i understand now what you mean.
[The next question, which is really unclear on Google Webmaster, concerns adding the x-default for Home pages only or all pages.
I think it should be in all pages.
As far as I understand, the x-default alternate link should always point to the site root, because this is the only URL from which Joomla! redirects to some language's home page depending on the settings (default or browser language detection), and the link can be added to all pages of the site.
I think the hreflang if for the alternate version of the page the crawler is reading.
For instance, if the crawler is reading page "content 1" in en-GB it expects a fr-FR alternative of "content 1" page, a es-ES alternative of "content 1" page, and a fr-FR (in this case x-default) of that page, not of the homepage.
So, in my opinion, this is what is needed for this to work:
addHeadLink
so it's possible to had several links with same href but different attributes@andrepereiradasilva Yes, i just read http://googlewebmastercentral.blogspot.fr/2013/04/x-default-hreflang-for-international-pages.html again and see it can be done in both ways, like I wrote (see example there, would be a minimal solution) and like you describe it (would be the complete solution but as you mentioned it requires the improvement of addHeadLink and the way how the head links are stored in a list). I was maybe mislead by their example and that they always write "that this page doesn’t target any specific language or locale and is the default page when no other page is better suited", which made me think it should be the home page only, but the more I think it over, the more I favor the complete solution, which requres what you describe ... but the change of the header link handling could be a bigger thing because currently they are stored in an associative array with the URL as key, as far as I remember. I always asked myself who ever could have this crazy idea, because it never was forbidden by any standards to have several head links pointing to the same url for different purpose.
Therefore we have here 3 aspects to consider:
1. Remove URL Language Code should anyway not be a parameter as well as SEF on or not.
2. If each page should have a x-default, what are we going to do if there is no association? Our multilingual implementation allows this.
3. What would happen when we get on a page (drilldown) which does not have a specific menu item?
imho any non-automatic solution would be unmanageable.
My opinion:
Remove URL Language Code should anyway not be a parameter as well as SEF on or not.
I'm not quite sure what you mean here.
"Remove URL Language Code should anyway not be a parameter" - Remove the "Remove URL Language Code" in the plugin?
"as SEF on or not" - Remove the "Search Engine Friendly URLs" on or off in global config?
Don't agree with both. I websites with on and others with off, depending on whats needed.
If each page should have a x-default, what are we going to do if there is no association? Our multilingual implementation allows this.
The same this we do for the other hrelang in pages that don't have association. Don't put it.
What would happen when we get on a page (drilldown) which does not have a specific menu item?
Articles and categories can be associated to so, like "2."
Another thing, i think in "System - Language Filter" plugin "Add Alternate Meta Tags" should depend on "Item Associations" set to "Yes".
Labels |
Added:
?
|
@infograf768 can you check now?
I think the only thing missing is "Improvements to addHeadLink so it's possible to had several links with same the same href but different attributes" but i don't know how to do this without breaking B/C, so used a custom tag.
Also i notice if i use showon field attribute inside another field already in showon (https://github.com/andrepereiradasilva/joomla-cms/blob/hreflang-x-default/plugins/system/languagefilter/languagefilter.xml#L63) it doesn't work properly.
Much better.
Remarks:
Your patch forces a x-default, i.e. there is no Option to not use it although we have
PLG_SYSTEM_LANGUAGEFILTER_FIELD_XDEFAULT_DESC="This option will add x-default hreflang link tag to improve SEO"
I suggest to add a new field to set the Option (using this desc) and change the desc for the x-default field and change code accordingly with a new conditional.
I confirm the issue with showon. Would be nice if we could correct this.
I ask @dgt41 if he can solve.
In the meanwhile you could use showon="alternate_meta:1"
for the 3 fields.
Your patch forces a x-default, i.e. there is no Option to not use it although we have
PLG_SYSTEM_LANGUAGEFILTER_FIELD_XDEFAULT_DESC="This option will add x-default hreflang link tag to improve SEO"
I suggest to add a new field to set the Option (using this desc) and change the desc for the x-default field and change code accordingly with a new conditional.
ok will do later
I confirm the issue with showon. Would be nice if we could correct this.
I ask @dgt41 if he can solve.
Not yet complete, but already working on a solution
Update: #8524
Test instructions updated
Category | ⇒ | Plugins |
Labels |
I have tested this item successfully on f83dbd3
Tested with #8524 and works fine.
I have tested this item successfully on f83dbd3
Test OK
Status | Pending | ⇒ | Ready to Commit |
Labels |
Thanks - set to RTC - (not sure why it would not be included until 3.6 but I guess thats for a maintainer to decide)
Labels |
Added:
?
|
Milestone |
Added: |
Milestone |
Added: |
Milestone |
Removed: |
i tested with latest staging and it work. But let @infograf768 test.
tomorrow i will. i just could see that the "language" type is wrong. The type should be "contentlanguage".
@infograf768 i didn't understand what you mean.
@infograf768 i didn't understand what you mean.
Oops, in fact you did it.
name="xdefault_language" type="contentlanguage"
Just a small cs for the en-GB lang strings values:
Change:
Add x-default meta tag
to Add x-default Meta Tag
and
X-default language
to x-default Language
X-default language to x-default Language
The "X" is for the label title case in this one.
x-default
is a sort of tag. I do not think we should capitalise it.
@brianteeman
Could you give your insight on this?
This tag was created by google. I can find no example of where it is ever
capitalised so i would agree it should not be capitalised in the desc
On 18 January 2016 at 17:48, infograf768 notifications@github.com wrote:
x-default is a sort of tag. I do not think we should capitalise it.
@brianteeman https://github.com/brianteeman
Could you give your insight on this?—
Reply to this email directly or view it on GitHub
#8442 (comment).
Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
http://brian.teeman.net/
This PR has received new commits.
CC: @anibalsanchez, @infograf768
Done.
Milestone |
Added: |
Milestone |
Removed: |
Status | Ready to Commit | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-01-21 09:56:48 |
Closed_By | ⇒ | wilsonge |
Labels |
Removed:
?
|
Ar reading this:
http://googlewebmastercentral.blogspot.fr/2013/04/x-default-hreflang-for-international-pages.html
I understand the instructions above as using as a new alternate with x-default a chosen language whether using URL Language code or not.
That language could be the site default language per default, but I guess it should be chosen by the site maintainer, i.e. would need a new parameter in the plugin.