class DrupalLinkMetaTag in Metatag 7
Link type meta tag controller.
Hierarchy
- class \DrupalDefaultMetaTag implements DrupalMetaTagInterface
- class \DrupalTextMetaTag
- class \DrupalLinkMetaTag
- class \DrupalTextMetaTag
Expanded class hierarchy of DrupalLinkMetaTag
6 string references to 'DrupalLinkMetaTag'
- metatag.search_api.inc in ./
metatag.search_api.inc - Contains MetatagSearchAlterCallback.
- metatag_favicons_metatag_info in metatag_favicons/
metatag_favicons.metatag.inc - Implements hook_metatag_info().
- metatag_google_plus_metatag_info in metatag_google_plus/
metatag_google_plus.metatag.inc - Implements hook_metatag_info().
- metatag_hreflang_metatag_info in metatag_hreflang/
metatag_hreflang.metatag.inc - Implements hook_metatag_info().
- metatag_metatag_info in ./
metatag.metatag.inc - Implements hook_metatag_info().
File
- ./
metatag.inc, line 629 - Metatag primary classes.
View source
class DrupalLinkMetaTag extends DrupalTextMetaTag {
/**
* {@inheritdoc}
*/
public function getElement(array $options = array()) {
$element = isset($this->info['element']) ? $this->info['element'] : array();
$value = $this
->getValue($options);
if (strlen($value) === 0) {
return array();
}
$element += array(
'#theme' => 'metatag_link_rel',
'#tag' => 'link',
'#id' => 'metatag_' . $this->info['name'],
'#name' => $this->info['name'],
'#value' => $value,
'#weight' => $this
->getWeight(),
);
if (!isset($this->info['header']) || !empty($this->info['header'])) {
// Also send the generator in the HTTP header.
// @todo This does not support 'rev' or alternate link headers.
$element['#attached']['drupal_add_http_header'][] = array(
'Link',
'<' . $value . '>;' . drupal_http_header_attributes(array(
'rel' => $element['#name'],
)),
TRUE,
);
}
return array(
'#attached' => array(
'drupal_add_html_head' => array(
array(
$element,
$element['#id'],
),
),
),
);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DrupalDefaultMetaTag:: |
protected | property | The values submitted for this tag. | |
DrupalDefaultMetaTag:: |
protected | property | All of the basic information about this tag. | |
DrupalDefaultMetaTag:: |
protected | property | This item's weight; used for sorting the output. | |
DrupalDefaultMetaTag:: |
protected | function | Make sure a given URL is absolute. | |
DrupalDefaultMetaTag:: |
public | function |
Calculate the weight of this meta tag. Overrides DrupalMetaTagInterface:: |
|
DrupalDefaultMetaTag:: |
protected | function | Identify the maximum length of which strings will be allowed. | |
DrupalDefaultMetaTag:: |
public static | function |
Copied from text.module with the following changes:. Overrides DrupalMetaTagInterface:: |
|
DrupalDefaultMetaTag:: |
protected | function | Remove unwanted formatting from a meta tag. | |
DrupalDefaultMetaTag:: |
protected | function | Shorten a string to a certain length using ::textSummary(). | |
DrupalDefaultMetaTag:: |
public | function |
Constructor. Overrides DrupalMetaTagInterface:: |
1 |
DrupalLinkMetaTag:: |
public | function |
Get the HTML tag for this meta tag. Overrides DrupalDefaultMetaTag:: |
|
DrupalTextMetaTag:: |
public | function |
Build the form for this meta tag. Overrides DrupalDefaultMetaTag:: |
1 |
DrupalTextMetaTag:: |
public | function |
Get the string value of this meta tag. Overrides DrupalDefaultMetaTag:: |
1 |