开发者

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

开发者 https://www.devze.com 2023-02-05 05:01 出处:网络
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 mod

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')

0

精彩评论

暂无评论...
验证码 换一张
取 消