Currently the navigation links appear in the links section of the node page (with comment links,...).
For easier theming, it would be nice to have a block available too.

CommentFileSizeAuthor
#1 block-links-1979500-1.patch2.42 KBlukio
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

lukio’s picture

Status: Needs work » Needs review
FileSize
2.42 KB

The attached patch provides a block which renders prev and next links.

The code that builds the links was moved from hook_node_view to its own function.

I patched the views_navigation.module first with the #1990384: Files should be formatted with \n as the line ending (Unix line endings), not \r\n (Windows line endings). issue

GaëlG’s picture

Status: Needs review » Fixed

Great, thank you.
I added DRUPAL_CACHE_PER_PAGE in the hook_block_info: the block content will change according to the GET parameters. This is a common omission which can give cached sites a weird behavior.

I also rewrote a bit the code in hook_block_view: no need to return an array with empty values: the default NULL return value for functions should be correctly handled by Drupal. And I moved the new helper function views_navigation_get_links() to the .inc file to keep the .module clear (only hooks).

Anyway, thank you again and long life to cooperatives ;)

Committed to dev.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.