3

I found the Previous/Next API module that lets you create previous-post & next-post buttons, that you could put on any node.

For example, if you have nodes of the content type "Blog" you could put such two buttons under them in one div.

A core-only way would most likely include 2 view-blocks styled with some css (most probably display: flex; flex-wrap: wrap; etc).

  • You forget to post the module link. – Jimmy Ko Aug 1 '16 at 14:25
  • And, you need to mention what previous and next stand for. By entity ID or post date or what? – Jimmy Ko Aug 1 '16 at 14:27
  • I assume you mean "core only" you mean, "no custom code?" – nvahalik Aug 1 '16 at 14:38
  • Deleted in Edit. Yest, by entity ID. – JohnDoea Aug 1 '16 at 15:23
4
+100

This you can do easily with the Core Book module. As you can see on the any Drupal.org page for example, Drupal.org page.

drupal.org page

Using Book module

  • You can create a Book which is like index and add the nodes in-order you want, and it will show Next and Prev as shown in above page as title of that node.

D8 site scree shot:

Configuration page

enter image description here

Example Page:

enter image description here

|improve this answer|||||
  • 2
    Hey!! there is a book module in core I have used that, let me just post image from my D8 site. – CodeNext Aug 1 '16 at 17:40
  • You were right. Anyway, listen, you say that I can insert all nodes I want to the book right ? So to make a book of all blog_nodes (all nodes of the content type "blog")... If so, how can I make sure this is automatically updated? I.E, each time there's a new node for "blog" CT, it will automatically be added to the book ? – JohnDoea Aug 1 '16 at 17:48
  • It will not add automatically, but as you can see Tab Outline in the second image, It provides where you want to add. And if you create Blog, and at page end like in any content type, it provides the setting where you want to place, before saving it. But , if you want that, blog gets automatically place in list, you probably can achieve this by Views module. – CodeNext Aug 1 '16 at 18:12
1

As you said you can simply achieve that by using views.

Configure the view as follows:

  1. Create a view of show "content" of type "Blog".

    enter image description here

  2. You can select Format as Grid and Add Fields as many you want from that content type.

  3. Set Pager as Mini.

  4. Configure the Mini Pager settings like follows

enter image description here

  1. Save the view and the output will looks like follows.

enter image description here

That's it. Hope this provides an answer to your question.

|improve this answer|||||
  • Suggested edit: I guess you mean to create a view-block; But how will the previous and next be relational to the Node that the user landed in ? – JohnDoea Aug 1 '16 at 15:31
  • I guess some kind of argument is needed for the view-block. – JohnDoea Aug 1 '16 at 18:59
  • Bounty ends in 3 days; Clarifications would be most appreciated... – JohnDoea Aug 5 '16 at 14:58
  • Krishna's solution is correct- the next/prev are related to the current node based on your view's Filter & Sort criteria- i.e. filter by content type: articles and sort by post date. – adam_bear Aug 5 '16 at 20:17

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.