 

 [    ](https://www.facebook.com/sharer/sharer.php?u=https://www.skvare.com/markdownify/node/109&title=Node%20Title%20for%20Custom%20Pagers "Share to Facebook") [    ](https://www.linkedin.com/sharing/share-offsite/?url=https://www.skvare.com/markdownify/node/109 "Share to Linkedin") [    ](mailto:?subject=Node%20Title%20for%20Custom%20Pagers&body=https://www.skvare.com/markdownify/node/109 "Share to Email") 

 

 

#  Node Title for Custom Pagers 

 

 

 [Custom Pagers](http://drupal.org/project/custom_pagers) module adds useful navigation to chosen nodes. The navigation can be displayed at the top and/or bottom of node's content, allows selection of specific node types, and further tweaking can be done with views. By default, however, custom pagers can only print &lt;previous next &gt;. How to display the node titles instead? Add this function to the template.php of the chosen theme:

```

function phptemplate_preprocess_custom_pager(&$vars) {

$nav = $vars['nav_array'];
  $prev = 'prev';
  if (!empty($nav['prev'])) {
    $nodeObj = node_load($nav['prev']);
    if ($nodeObj) {
      $prev = node_page_title($nodeObj);
    }
  }

  $next = 'next';
  if (!empty($nav['next'])) {
    $nodeObj = node_load($nav['next']);
    if ($nodeObj) {
      $next = node_page_title($nodeObj);
    }
  }

$vars['previous'] = !empty($nav['prev']) ? l('‹ ' . $prev, 'node/'. $nav['prev']) : '';
$vars['next'] =  !empty($nav['next']) ? l($next . ' ›', 'node/'. $nav['next']) : '';

}
```

Clear all caches and you should see node titles as navigation above/below the node's content. This approach also lends itself to customization for variety of uses, such as displaying pictures as &lt; previous # of # next &gt;. A quick function and some imagination is all that's needed!