function drupal_add_html_head_link

cis7 common.inc drupal_add_html_head_link($attributes, $header = FALSE)
cle7 common.inc drupal_add_html_head_link($attributes, $header = FALSE)
elmsmedia7 common.inc drupal_add_html_head_link($attributes, $header = FALSE)
icor7 common.inc drupal_add_html_head_link($attributes, $header = FALSE)
meedjum_blog7 common.inc drupal_add_html_head_link($attributes, $header = FALSE)
mooc7 common.inc drupal_add_html_head_link($attributes, $header = FALSE)

Adds a LINK tag with a distinct 'rel' attribute to the page's HEAD.

This function can be called as long the HTML header hasn't been sent, which on normal pages is up through the preprocess step of theme('html'). Adding a link will overwrite a prior link with the exact same 'rel' and 'href' attributes.

Parameters

$attributes: Associative array of element attributes including 'href' and 'rel'.

$header: Optional flag to determine if a HTTP 'Link:' header should be sent.

13 calls to drupal_add_html_head_link()
drupal_add_feed in includes/common.inc
Adds a feed URL for the current page.
ds_extras_node_page_view in sites/all/modules/ulmus/ds/modules/ds_extras/includes/ds_extras.pages.inc
Menu callback: show an individual node with the Switch field.
file_entity_view_page in sites/all/modules/ulmus/file_entity/file_entity.pages.inc
Menu callback; view a single file entity.
node_page_view in modules/node/node.module
Menu callback: Displays a single node.
openid_test_html_openid1 in modules/openid/tests/openid_test.module
Menu callback; regular HTML page with OpenID 1.0 <link> element.

... See full list

File

includes/common.inc, line 2834
Common functions that many Drupal modules will need to reference.

Code

function drupal_add_html_head_link($attributes, $header = FALSE) {
  $element = array(
    '#tag' => 'link',
    '#attributes' => $attributes,
  );
  $href = $attributes['href'];

  if ($header) {
    // Also add a HTTP header "Link:".
    $href = '<' . check_plain($attributes['href']) . '>;';
    unset($attributes['href']);
    $element['#attached']['drupal_add_http_header'][] = array('Link', $href . drupal_http_header_attributes($attributes), TRUE);
  }

  drupal_add_html_head($element, 'drupal_add_html_head_link:' . $attributes['rel'] . ':' . $href);
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.