MetaManager

meta/MetaManager~ MetaManager

The Meta manager is a utility for managing various page attributes related to the SEO (search engine optimization) and social network integration. The Meta manager is used to manage the following: - page title, set using the contents of the <title> element - page links, linking related documents and meta-information, added to the using <link> elements - page meta information: - the generic named meta information added to the page via <meta> elements with the name attribute, for example the keywords. - specialized meta information added to the page via <meta> elements with the property attribute, for example the OG meta tags (og:type, og:image, etc.).

Methods

Source:
Return the reference to the specified related linked document. The method returns an empty string for missing meta information (to make the returned value React-friendly).
Parameters:
Name Type Description
relation string The relation of the link target to the current page.
Returns:
The reference to the location of the related document, e.g. a URL.
Type
string
Source:
Returns the relations of the currently set related documents linked to the current page.
Returns:
Type
Array.<string>

getMetaName(name) → {string}

Source:
Returns the value of the specified named meta information property. The method returns an empty string for missing meta information (to make the returned value React-friendly).
Parameters:
Name Type Description
name string The name of the named meta information property.
Returns:
The value of the generic meta information, or an empty string.
Type
string

getMetaNames() → {Array.<string>}

Source:
Returns the names of the currently specified named meta information properties.
Returns:
The names of the currently specified named meta information properties.
Type
Array.<string>

getMetaProperties() → {Array.<string>}

Source:
Returns the names of the currently specified specialized meta information properties.
Returns:
The names of the currently specified specialized meta information properties.
Type
Array.<string>

getMetaProperty(name) → {string}

Source:
Returns the value of the specified specialized meta information property. The method returns an empty string for missing meta information (to make the returned value React-friendly).
Parameters:
Name Type Description
name string The name of the specialized meta information property.
Returns:
The value of the specified meta information, or an empty string.
Type
string

getTitle() → {string}

Source:
Returns the page title. The method returns an empty string if no page title has been set yet. Note that the page title is cached internally by the meta manager and may therefore differ from the current document title if it has been modified by a 3rd party code.
Returns:
The current page title.
Type
string
Source:
Sets the specified specialized link information.
Parameters:
Name Type Description
relation string The relation of the link target to the current page.
reference string The reference to the location of the related document, e.g. a URL.

setMetaName(name, value)

Source:
Set the specified named meta information property.
Parameters:
Name Type Description
name string Meta information property name, for example keywords.
value string The meta information value.

setMetaProperty(name, value)

Source:
Sets the specified specialized meta information property.
Parameters:
Name Type Description
name string Name of the specialized meta information property.
value string The value of the meta information property.

setTitle(title)

Source:
Sets the page title.
Parameters:
Name Type Description
title string The new page title.