-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmetatag.theme.inc
71 lines (65 loc) · 1.88 KB
/
metatag.theme.inc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?php
/**
* @file
* Theme callbacks for the metatag module.
*/
/**
* Theme callback for a normal meta tag.
*
* The format is:
* <meta name="[name]" content="[value]" />
*/
function theme_metatag($variables) {
$element = &$variables['element'];
\Drupal\Core\Render\Element::setAttributes($element, array('name', '#value' => 'content'));
unset($element['#value']);
return _theme('html_tag', $variables);
}
/**
* Theme callback for a normal meta tag.
*
* The format is:
* <meta http-equiv="[name]" content="[value]" />
*/
function theme_metatag_http_equiv($variables) {
$element = &$variables['element'];
\Drupal\Core\Render\Element::setAttributes($element, array('#name' => 'http-equiv', '#value' => 'content'));
unset($element['#value']);
return _theme('html_tag', $variables);
}
/**
* Theme callback for a rel link tag.
*
* The format is:
* <link rel="[name]" href="[value]" />
*/
function theme_metatag_link_rel($variables) {
$element = &$variables['element'];
\Drupal\Core\Render\Element::setAttributes($element, array('#name' => 'rel', '#value' => 'href'));
unset($element['#value']);
return _theme('html_tag', $variables);
}
/**
* Theme callback for a rev link tag.
*
* The format is:
* <link rev="[name]" href="[value]" />
*/
function theme_metatag_link_rev($variables) {
$element = &$variables['element'];
\Drupal\Core\Render\Element::setAttributes($element, array('#name' => 'rev', '#value' => 'href'));
unset($element['#value']);
return _theme('html_tag', $variables);
}
/**
* Theme callback for a proprty meta tag.
*
* The format is:
* <meta property="[name]" content="[value]" />
*/
function theme_metatag_property($variables) {
$element = &$variables['element'];
\Drupal\Core\Render\Element::setAttributes($element, array('#name' => 'property', '#value' => 'content'));
unset($element['#value']);
return _theme('html_tag', $variables);
}