Bug #86577

hreflang and canonical ignores extension parameters

Added by Marc Hirdes over 2 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Must have
Category:
SEO
Start date:
2018-10-05
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
9
PHP Version:
7.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

To link to a detail page via hreflang and canonical without any extension parameter must be avoided. Currently it is only possible to hook into the canonical generation. I found no way to change the hreflang. It would be great if the language menue processor adds all parameters, which are used to calculate the cHash, e.g. add $GLOBALS['TSFE']->cHash_array.


Related issues

Related to TYPO3 Core - Task #86545: Make canonical and hreflang optionalClosedRichard Haeser2018-10-02

Actions
Related to TYPO3 Core - Feature #86847: addQueryString for languageMenuProcessorClosed2018-11-04

Actions
Related to TYPO3 Core - Feature #87128: Add acceptance test concerning canonicalized URL creationClosed2018-12-11

Actions
Has duplicate TYPO3 Core - Bug #86866: Hreflang tags for pages with extension records not correctClosed2018-11-06

Actions
Has duplicate TYPO3 Core - Bug #86865: Canonical tag for pages with extension records not correctClosed2018-11-06

Actions
#1

Updated by Richard Haeser over 2 years ago

  • Status changed from New to Needs Feedback

I see the issue with the language menu processor indeed. As far as I can see, you can't add the addQueryString option. But do you have issues with canonical as well? Because that is already adding the current query string.

#2

Updated by Christian Knauf over 2 years ago

Richard Haeser wrote:

I see the issue with the language menu processor indeed. As far as I can see, you can't add the addQueryString option. But do you have issues with canonical as well? Because that is already adding the current query string.

Have an extension provided with a routeEnhancers, but the Canonical tag on the detail pages does not change and displays the Canonical tag of the page, where the extension is included.

.....
routeEnhancers:
Suffix:
type: PageType
default: ''
map:
sitemap.xml: 1533906435
Location Plugin:
type: Extbase
limitToPages:
- 5
extension: Amlocations
plugin: Locations
routes:
-
routePath: '/ location / {location_title}'
_controller: 'Location :: show'
_arguments:
location_title: location
defaultController: 'Location :: show'
aspects:
location_title:
type: PersistedAliasMapper
tableName: tx_amlocations_domain_model_location
routeFieldName: path_segment

.....

#3

Updated by Richard Haeser over 2 years ago

  • Related to Task #86545: Make canonical and hreflang optional added
#4

Updated by Richard Haeser over 2 years ago

  • Status changed from Needs Feedback to Accepted
  • Assignee set to Richard Haeser
  • Target version set to Candidate for patchlevel
#5

Updated by Marc Hirdes over 2 years ago

Until this not works and also otherwise, it would be great to provide a hook for the hreflang.

#6

Updated by Richard Haeser over 2 years ago

  • Status changed from Accepted to In Progress
#7

Updated by Richard Haeser over 2 years ago

The canonical is only not created correctly when route enhancers are set

#8

Updated by Gerrit Code Review over 2 years ago

  • Status changed from In Progress to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58611

#9

Updated by Ben Robinson over 2 years ago

I would like to test the patch. Is there already an extension available for 9 LTS that supports route enhancers and has a list and detail view?

#10

Updated by Marc Hirdes over 2 years ago

To use addQueryString is maybe not a good idea. It would be better to add all params, that are used to generate the cHash. They are stored in the $GLOBALS['TSFE']->cHash_array. Maybe you like to take a look here https://github.com/clickstorm/cs_seo/issues/171

#11

Updated by Ben Robinson over 2 years ago

I do not exactly know yet how to properly test the patch, therefore one question:
Does the LanguageMenuProcessor used in the patch check if there is a translation for the record?

Imagine the following:

1. List view:
Default language: www.domain.com/news
Translation: www.domain.de/news
This is easy, since there are no Get-Parameters. It just needs to be checked if the translation for this page exists.

2. List view, page 2
Default language: www.domain.com/news/page/2
It must be checked if this "list view page 2" is available in the translation.
If it is not available, the hreflang for this language needs to be skipped

3. Detail view
Default language: www.domain.com/news/id/25
It must be checked if there is a translation for item 25.
If it is not available, the hreflang for this language needs to be skipped

#12

Updated by Gerrit Code Review over 2 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58611

#13

Updated by Gerrit Code Review over 2 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58611

#14

Updated by Richard Haeser over 2 years ago

  • Has duplicate Bug #86866: Hreflang tags for pages with extension records not correct added
#15

Updated by Richard Haeser over 2 years ago

  • Has duplicate Bug #86865: Canonical tag for pages with extension records not correct added
#16

Updated by Richard Haeser over 2 years ago

  • Related to Feature #86847: addQueryString for languageMenuProcessor added
#17

Updated by Gerrit Code Review over 2 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58611

#18

Updated by Gerrit Code Review over 2 years ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58611

#19

Updated by Gerrit Code Review over 2 years ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58611

#20

Updated by Gerrit Code Review over 2 years ago

Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58611

#21

Updated by Gerrit Code Review over 2 years ago

Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58611

#22

Updated by Gerrit Code Review over 2 years ago

Patch set 9 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58611

#23

Updated by Gerrit Code Review over 2 years ago

Patch set 10 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58611

#24

Updated by Gerrit Code Review over 2 years ago

Patch set 11 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58611

#25

Updated by Gerrit Code Review over 2 years ago

Patch set 12 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58611

#26

Updated by Gerrit Code Review over 2 years ago

Patch set 13 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58611

#27

Updated by Gerrit Code Review over 2 years ago

Patch set 14 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58611

#28

Updated by Gerrit Code Review over 2 years ago

Patch set 15 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58611

#29

Updated by Gerrit Code Review over 2 years ago

Patch set 16 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58611

#30

Updated by Gerrit Code Review over 2 years ago

Patch set 17 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58611

#31

Updated by Gerrit Code Review over 2 years ago

Patch set 18 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58611

#32

Updated by Gerrit Code Review over 2 years ago

Patch set 19 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58611

#33

Updated by Gerrit Code Review over 2 years ago

Patch set 20 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58611

#34

Updated by Gerrit Code Review over 2 years ago

Patch set 21 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58611

#35

Updated by Richard Haeser over 2 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
#36

Updated by Steffen Dietrich over 2 years ago

  • Related to Feature #87128: Add acceptance test concerning canonicalized URL creation added
#37

Updated by Benni Mack about 2 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF