Feature #88242
closed
Added by Christoph Hendreich almost 5 years ago.
Updated over 4 years ago.
Description
It would be useful to have a TypoScript option which deactivates the generation of the canonical tag or to remove some paramter, like a fixed pagetype.
For example, when using an AMP template using pagetype, AMP output page must have the canonical to the HTML main page.
<link rel="canonical" href="https://www.domain.de/de/page-de/"/>
<link rel="alternate" hreflang="de" href="https://www.domain.de/de/page-de"/>
<link rel="alternate" hreflang="en" href="https://www.domain.de/en/page-en"/>
<link rel="alternate" hreflang="x-default" href="https://www.domain.de/de/page-de/"/>
<link rel="amphtml" href="https://www.domain.de/de/page-de/amp/" />
Alternative with subdomain <link rel="amphtml" href="https://amp.domain.de/de/page-de/" />
https://amp.dev/documentation/examples/guides/internationalization/?format=websites#example-1-canonical-amp
Every AMP document must have a link tag with rel=canonical pointing to its matching canonical desktop document, again, in the same language.
- Related to Task #86545: Make canonical and hreflang optional added
- Related to Bug #87760: Option to remove params from canonical tag added
The chash configuration is used to determine which parameters are used when rendering the link. So all parameters that are relevant to calculate the cHash are kept in generating the url. All other parameters are dropped.
There is a signal slot available where you have the possibility to set the canonical link yourself. You can use the signalName `beforeGeneratingCanonical` for the class `\TYPO3\CMS\Seo\Canonical\CanonicalGenerator`. In that way you can set your own canonical tag and can create the canonical without the type.
I think you can use that for your usecase.
- Tracker changed from Task to Feature
- Status changed from New to Needs Feedback
- Priority changed from Must have to Could have
- Target version deleted (
next-patchlevel)
Many thanks for the information, we have already implemented this.
In this case we noticed that the canonical and the language data were different.
Example:
<link rel="canonical" href="https://www.domain.de/de/page/amp/">
<link rel="alternate" hreflang="de" href="https://www.domain.de/de/page/">
<link rel="alternate" hreflang="en" href="https://www.domain.de/de/page/">
<link rel="alternate" hreflang="x-default" href="https://www.domain.de/de/page/">
If so, should everything run the same for both parameters?
I think it would make sense anyway to present a way to disable this directly via TS.
Thus there are still further possibilities of the adjustment directly over Pagetype in the TS.
Because a canonical can also be rendered and output via VHS and an on and off switch would be the most efficient here, I think.
page.config {
canonical = 0
hreflang = 0
}
I would strongly support the solution with typoscript. I am updating an number of old TYPO3 installations end ends up with many duplicate canonicals.
- Status changed from Needs Feedback to Under Review
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
- Status changed from Resolved to Closed
Also available in: Atom
PDF