Download the PHP package nemo64/canonical-url without Composer
On this page you can find all versions of the php package nemo64/canonical-url. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download nemo64/canonical-url
More information about nemo64/canonical-url
Files in nemo64/canonical-url
Package canonical-url
Short Description Makes your typo3 aware of the url it is used on
License GPL-2.0-or-later
Informations about the package canonical-url
EXT:canonical_url
This extension adds some canonical url features to your page.
This extension is based on my Blog Post (in german) in which you can read more about the topic of canonical urls in typo3 and why they aren't as simple as they should be.
There are also a lot of extension that already bring canonical support with varying implementation quality but in those the canonical url is just one of many features.
This extension only focuses on how to handle the current page url and you can install this extension and just use the typoscript extensions without any page modifications if you want to have full control.
I encourage you to use this extension as a dependency in your extension if you need canonical_parameters. This extension won't do anything except for providing the canonical_parameters getText function (and later maybe more ways like view helpers). The integrator will always have to include the static typoscript for this extension to have any effect. It is therefor a save dependency.
Main features
Static TypoScript template for <link rel="canonical">
This extensions adds a TypoScript for you to use. Just add the fittingly named <link rel="canonical"> (canonical_url)
static include to your typoscript template and you are all set.
TypoScript extension data = canonical_parameters
You can use the new getText funktion canonical_parameters
to get the query string to the current page. This is different to addQueryString in that it only includes parameters that are relevant for the cache and therefor validated using the cHash Mechanismus.
Here an example on how to create a link to the current page:
And here an example on how to create a breadcrumb where the last entry is the current page:
And here an example on how to implement hreflang:
All versions of canonical-url with dependencies
typo3/cms-core Version ~8.7.7 || ^9.5
typo3/cms-frontend Version ~8.7.7 || ^9.5