Prints the canonical address of the page that search engines should link to.
Kuvaus
The tag prints the address relative to the online store's root address (e.g. /product/5/hat). Add the domain to the address using the {ShopURL} tag.
The tag is mostly used in the <link> element's href attribute.
<link rel="canonical" href="{ShopUrl}{CanonicalURL}" />This prevents search engines from indexing the same product more than once by using different addresses (e.g. /product/5/hat ja /product/5).
By using the {CanonicalURL} tag, you can also prevent, for example, the development version (development.store.mycashflow.fi) from being indexed by search engines:
<link rel="canonical" href="https://www.storeaddress.fi{CanonicalURL}" />Syntaksi
{CanonicalURL( version: int )}Näkyvyys
Toimii näkyvyydessä: globaali
It is possible to use global visibility tags in any page template and within any tag.
Defining language data in multilingual online stores
For each page in a multilingual online store, you may want to add data about the page's existing language versions as well as the page's language to its <head> section. This is done by using the {CanonicalURL} tag's version attribute:
<head> {CanonicalUrl(version: 1, before: '<link rel="alternate" href="https://www.example.com', after: '" hreflang="en" />')} {CanonicalUrl(version: 2, before: '<link rel="alternate" href="https://fi.example.com', after: '" hreflang="fi-fi" />')} {CanonicalUrl(version: 3, before: '<link rel="alternate" href="https://www.example.de', after: '" hreflang="de-de" />')} {CanonicalUrl(version: 4, before: '<link rel="alternate" href="https://www.example.fr', after: '" hreflang="fr" />')} {CanonicalUrl(version: 5, before: '<link rel="alternate" href="https://www.example.com', after: '" hreflang="x-default" />')} ...Note that, for each link, the language is defined in the link element's hreflang attribute.
Attribuutit
version:Defines the version whose address should be printed.
Sallitut arvot: Version ID-numero. Esim.version:3before/after:With the
beforeandafterattributes, you can define content that is output before or after the content produced by the tag.Allowed values: text that may contain HTML and Interface markup.
E.g.
before:'<p>This markup appears before the tag's own content.</p>'.after:'<p>This appears after the tag's own content.</p>'
If the tag does not produce any content, the content of the
beforeandafterattributes will also not be displayed.escape:Adds an escape character before quotation marks in the output. The attribute makes it easier to process the tag-produced content when using JavaScript.
Allowed values: true/false. The default value is false.
or:Defines alternative content that is displayed if the tag itself does not produce any content.
Allowed values: text that may contain HTML and Interface markup.
E.g.
or:'Content not found.'
