1

Using Drupal 7. I have a "people" content node for employee biographies. I have a views page that aggregates the display of people content types into a 5 across by 2 deep grid. Each cell is a portrait over the person's name. I've hyperlinked the image/name with a classed anchor to invoke the colorbox node function to display the particular "people" node content within a colorbox display. It's all working nicely, but I need to add one more navigational element.

I'd like to add "prev/next" links to the node, using the "Previous/Next API" module. I've added this code to my template.php file as per the page. Next I'd like to add the template code for the "Colorbox" Display Suite for the "People" content type:

<?php
  $nextPost = pn_node($node, 'n');
  $prevPost = pn_node($node, 'p'); 
  if ($nextPost != NULL) {
    print '<div class="newer_post">Newer:'. $nextPost .'</div>';
  };
  if ($prevPost != NULL) {
    print '<div class="older_post">Older:'. $prevPost .'</div>';
  };
?>

I've created a display suite "custom field" and have input the above using the "Display Suite Code" input formatter.

I've added a "colorbox" view mode display for "people" and it's working as it should, namely, my changes to that view mode reflect in the colorbox output. The prev/next module is working on all 9 people are indexed as reported by drush cron after configuring the module to index the people content type. I've run drush cc all to clear caches.

However, I am not seeing the rendered links as per the above custom code. Nothing prints in the region where I have set the custom field to output.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.