CanonicalMetaTagManager

final class \TYPO3\CMS\Seo\MetaTag\CanonicalMetaTagManager

Implements
MetaTagManagerInterface

Holds the canonical URL of the page and renders it as <link rel="canonical">.

The URL is part of the meta tag state, which is stored in the page cache and rendered after uncached content objects have been processed. This allows uncached plugins to replace or remove the canonical URL via the property "canonical".

Attributes

#[AsMetaTagManager]
$identifier: 'canonical'

Table of Contents

Interfaces

MetaTagManagerInterface

Methods

addProperty()  : void
A page has a single canonical URL, so any added value replaces the previous one.
canHandleProperty()  : bool
Check if this manager can handle the given property
getAllHandledProperties()  : array
Returns an array with all properties that can be handled by the manager
getProperty()  : array
Get a specific property that is set before
getState()  : array
removeAllProperties()  : void
Unset all properties of this MetaTagManager
removeProperty()  : void
Remove one property from the MetaTagManager If there are multiple occurrences of a property, they all will be removed
renderAllProperties()  : string
Render all registered properties of this manager
renderProperty()  : string
Render a meta tag for a specific property
updateState()  : void

Methods

addProperty()

A page has a single canonical URL, so any added value replaces the previous one.

public addProperty(string $property, string $content[, array $subProperties = [] ][, bool $replace = false ][, string $type = '' ]) : void

Parameters

$property : string
$content : string
$subProperties : array = []
$replace : bool = false
$type : string = ''

canHandleProperty()

Check if this manager can handle the given property

public canHandleProperty(string $property) : bool

Parameters

$property : string

Return values

bool

getAllHandledProperties()

Returns an array with all properties that can be handled by the manager

public getAllHandledProperties() : array

Return values

array

getProperty()

Get a specific property that is set before

public getProperty(string $property[, string $type = '' ]) : array

Parameters

$property : string
$type : string = ''

Return values

array

getState()

public getState() : array

Return values

array

removeAllProperties()

Unset all properties of this MetaTagManager

public removeAllProperties() : void

removeProperty()

Remove one property from the MetaTagManager If there are multiple occurrences of a property, they all will be removed

public removeProperty(string $property[, string $type = '' ]) : void

Parameters

$property : string
$type : string = ''

renderAllProperties()

Render all registered properties of this manager

public renderAllProperties([DocType|null $docType = null ]) : string

Parameters

$docType : DocType|null = null

Return values

string

renderProperty()

Render a meta tag for a specific property

public renderProperty(string $property[, DocType|null $docType = null ]) : string

Parameters

$property : string
$docType : DocType|null = null

Return values

string

updateState()

public updateState(array $state) : void

Parameters

$state : array
On this page