当前位置: 动力学知识库 > 问答 > 编程问答 >

Create Next/Previous node links in a node-panel in Drupal?

问题描述:

So I am on a seemingly simple mission of creating previous/next buttons for a type of nodes, like for pages in a book. Sounds easy enough, considering that there is the Custom Pager module. But, the module does not work for nodes which are built using panels, as described in this bug: http://drupal.org/node/591782

There is another module which creates an API for this operation, but it does not seem to have custom sorting based on a view.

Any ideas would be highly appreciated and thank you in advance.

网友答案:

What about using the views module (and its built-in pager functionality) to display a single node at a time?

网友答案:

In the end I used the code described in the bottom of this page, but had to modify it a little to sort by date:

http://drupal.org/node/37767

Then put it into a custom content pane using (note that I rearranged the variable order):

print node_sibling(node_load(arg(1)), 'previous')

print node_sibling(node_load(arg(1)), 'next')

分享给朋友:
您可能感兴趣的文章:
随机阅读: