‪TYPO3CMS  9.5
TYPO3\CMS\Core\MetaTag\AbstractMetaTagManager Class Reference
Inheritance diagram for TYPO3\CMS\Core\MetaTag\AbstractMetaTagManager:
TYPO3\CMS\Core\MetaTag\MetaTagManagerInterface TYPO3\CMS\Core\MetaTag\EdgeMetaTagManager TYPO3\CMS\Core\MetaTag\Html5MetaTagManager TYPO3\CMS\Seo\MetaTag\OpenGraphMetaTagManager TYPO3\CMS\Seo\MetaTag\TwitterCardMetaTagManager

Public Member Functions

 addProperty (string $property, string $content, array $subProperties=[], bool $replace=false, string $type='')
 
array getAllHandledProperties ()
 
array getProperty (string $property, string $type='')
 
string renderProperty (string $property)
 
string renderAllProperties ()
 
 removeProperty (string $property, string $type='')
 
 removeAllProperties ()
 
bool canHandleProperty (string $property)
 

Protected Attributes

string $defaultNameAttribute = 'name'
 
string $defaultContentAttribute = 'content'
 
bool $defaultAllowMultipleOccurrences = false
 
string $subPropertySeparator = ':'
 
array $handledProperties = array( )
 
array $properties = array( )
 

Detailed Description

Definition at line 19 of file AbstractMetaTagManager.php.

Member Function Documentation

◆ addProperty()

TYPO3\CMS\Core\MetaTag\AbstractMetaTagManager::addProperty ( string  $property,
string  $content,
array  $subProperties = [],
bool  $replace = false,
string  $type = '' 
)

Add a property

Parameters
string$property‪Name of the property
string$content‪Content of the property
array$subProperties‪Optional subproperties
bool$replace‪Replace the currently set value
string$type‪Optional type of property (name, property, http-equiv)
Exceptions

Implements TYPO3\CMS\Core\MetaTag\MetaTagManagerInterface.

Definition at line 96 of file AbstractMetaTagManager.php.

References TYPO3\CMS\Core\MetaTag\AbstractMetaTagManager\removeProperty().

◆ canHandleProperty()

bool TYPO3\CMS\Core\MetaTag\AbstractMetaTagManager::canHandleProperty ( string  $property)

Check if this manager can handle the given property

Parameters
string$property‪Name of property to check (eg. og:title)
Returns
‪bool

Implements TYPO3\CMS\Core\MetaTag\MetaTagManagerInterface.

Definition at line 284 of file AbstractMetaTagManager.php.

◆ getAllHandledProperties()

array TYPO3\CMS\Core\MetaTag\AbstractMetaTagManager::getAllHandledProperties ( )

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

Returns
‪array

Implements TYPO3\CMS\Core\MetaTag\MetaTagManagerInterface.

Definition at line 173 of file AbstractMetaTagManager.php.

References TYPO3\CMS\Core\MetaTag\AbstractMetaTagManager\$handledProperties.

◆ getProperty()

array TYPO3\CMS\Core\MetaTag\AbstractMetaTagManager::getProperty ( string  $property,
string  $type = '' 
)

Get a specific property that is set before

Parameters
string$property‪Name of the property
string$type‪Optional type of property (name, property, http-equiv)
Returns
‪array

Implements TYPO3\CMS\Core\MetaTag\MetaTagManagerInterface.

Definition at line 185 of file AbstractMetaTagManager.php.

Referenced by TYPO3\CMS\Core\MetaTag\AbstractMetaTagManager\renderProperty().

◆ removeAllProperties()

TYPO3\CMS\Core\MetaTag\AbstractMetaTagManager::removeAllProperties ( )

Unset all properties of this MetaTagManager

Implements TYPO3\CMS\Core\MetaTag\MetaTagManagerInterface.

Definition at line 273 of file AbstractMetaTagManager.php.

◆ removeProperty()

TYPO3\CMS\Core\MetaTag\AbstractMetaTagManager::removeProperty ( string  $property,
string  $type = '' 
)

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

Parameters
string$property
string$type

Implements TYPO3\CMS\Core\MetaTag\MetaTagManagerInterface.

Definition at line 263 of file AbstractMetaTagManager.php.

Referenced by TYPO3\CMS\Core\MetaTag\AbstractMetaTagManager\addProperty().

◆ renderAllProperties()

string TYPO3\CMS\Core\MetaTag\AbstractMetaTagManager::renderAllProperties ( )

Render all registered properties of this manager

Returns
‪string

Implements TYPO3\CMS\Core\MetaTag\MetaTagManagerInterface.

Definition at line 246 of file AbstractMetaTagManager.php.

References TYPO3\CMS\Core\MetaTag\AbstractMetaTagManager\renderProperty().

◆ renderProperty()

string TYPO3\CMS\Core\MetaTag\AbstractMetaTagManager::renderProperty ( string  $property)

Member Data Documentation

◆ $defaultAllowMultipleOccurrences

bool TYPO3\CMS\Core\MetaTag\AbstractMetaTagManager::$defaultAllowMultipleOccurrences = false
protected

Set if by default it is possible to have multiple occurrences of properties of this manager

Definition at line 41 of file AbstractMetaTagManager.php.

◆ $defaultContentAttribute

string TYPO3\CMS\Core\MetaTag\AbstractMetaTagManager::$defaultContentAttribute = 'content'
protected

The default attribute that defines the content

This creates tags like <meta content="" > by default

Definition at line 35 of file AbstractMetaTagManager.php.

Referenced by TYPO3\CMS\Core\MetaTag\AbstractMetaTagManager\renderProperty().

◆ $defaultNameAttribute

string TYPO3\CMS\Core\MetaTag\AbstractMetaTagManager::$defaultNameAttribute = 'name'
protected

The default attribute that defines the name of the property

This creates tags like <meta name="" > by default

Definition at line 27 of file AbstractMetaTagManager.php.

Referenced by TYPO3\CMS\Core\MetaTag\AbstractMetaTagManager\renderProperty().

◆ $handledProperties

array TYPO3\CMS\Core\MetaTag\AbstractMetaTagManager::$handledProperties = array( )
protected

Array of properties that can be handled by this manager

Example:

$handledProperties = [ 'og:title' => [], 'og:image' => [ 'allowMultipleOccurrences' => true, 'allowedSubProperties' => [ 'url', 'secure_url', 'type', 'width', 'height', 'alt' ] ], 'og:locale' => [ 'allowedSubProperties' => [ 'alternate' => [ 'allowMultipleOccurrences' => true ] ] ] ];

Definition at line 77 of file AbstractMetaTagManager.php.

Referenced by TYPO3\CMS\Core\MetaTag\AbstractMetaTagManager\getAllHandledProperties().

◆ $properties

array TYPO3\CMS\Core\MetaTag\AbstractMetaTagManager::$properties = array( )
protected

Array of properties that are set by the manager

Definition at line 83 of file AbstractMetaTagManager.php.

◆ $subPropertySeparator

string TYPO3\CMS\Core\MetaTag\AbstractMetaTagManager::$subPropertySeparator = ':'
protected

The separator to define subproperties like og:image:width

Definition at line 47 of file AbstractMetaTagManager.php.