Issue Feature Closed

#22992Pagerenderer - use better method for adding meta tags

Steffen Kamper 06/25/10, 01:04 updated 10/02/18, 12:42

Description

atm meta tags are added with complete html tag.
The better method would be to add tags with a name and the content.

Additional you can add additional parameters as key/value pairs in an array.

There is an exception: if in this additional parameters a pair exists with key “http-equiv”, it replaces the name.

Examples:

$pageRenderer->addMetaTag('author', 'John Doe');
=>
<meta name="author" content="John Doe" />

$pageRenderer->addMetaTag('robots', 'noindex');
=>
<meta name="robots" content="noindex" />
$pageRenderer->addMetaTag('author', 'John Doe');

$pageRenderer->addMetaTag('', '5; URL=http://www.example.org/', array('http-equiv' => 'refresh');
=>
<meta http-equiv="refresh" content="5; URL=http://www.example.org/" />

$pageRenderer->addMetaTag('DC.format', 'text/html', array('scheme' => 'DCTERMS.IMT');
=>
<meta name="DC.format" content="text/html" scheme="DCTERMS.IMT">

(issue imported from #M14860)

Reviews 2