You are here

function _flippy_add_head_elements in Flippy 7

Add the previous/next elements to the page head, if enable for the content type of the given node.

Parameters

$node: Node to add head elements for

2 calls to _flippy_add_head_elements()
flippy_node_view in ./flippy.module
Implements hook_node_view().
flippy_pager_block in ./flippy.module
Render the Flippy pager block.

File

./flippy.module, line 685
Allows administrators to add previous/next pagers to any node type.

Code

function _flippy_add_head_elements($node) {
  if (is_object($node)) {
    if (variable_get('flippy_head_' . $node->type, NULL)) {
      $links = flippy_build_list($node);
      if (!empty($links['prev'])) {
        drupal_add_html_head_link(array(
          'rel' => 'prev',
          'href' => url('node/' . $links['prev']['nid']),
        ));
      }
      if (!empty($links['next'])) {
        drupal_add_html_head_link(array(
          'rel' => 'next',
          'href' => url('node/' . $links['next']['nid']),
        ));
      }
    }
  }
}