You are here

public function BreadcrumbManagerTitleMetaTag::getElement in Breadcrumb Manager 7

Get the HTML tag for this meta tag.

Return value

array A render array for this meta tag.

Overrides DrupalTitleMetaTag::getElement

File

includes/breadcrumb_manager.metatag.inc, line 11

Class

BreadcrumbManagerTitleMetaTag
Title meta tag controller.

Code

public function getElement(array $options = array()) {
  $element = array();
  $value = $this
    ->getValue($options);
  if ($title = breadcrumb_manager_is_title_required()) {
    list(, $site_name) = explode('|', $value);
    $value = implode(' | ', array(
      $title,
      trim($site_name),
    ));
  }
  $element['#attached']['metatag_set_preprocess_variable'][] = array(
    'html',
    'head_title',
    $value,
  );
  $element['#attached']['metatag_set_preprocess_variable'][] = array(
    'html',
    'head_array',
    array(
      'title' => $value,
    ),
  );
  return $element;
}