0

How to create a pager to display next article in particular taxonomy? I can not find any module.

I tried to do this with a view. I created a view that display all content from article and add a pager, but then i've got another problem (cant related this with another view from home page that display image and title from all articles and navigate to chosen article)

Sorry for my english.

I have view that displays fields (image and title) from articles with taxonomy term (e.g. Shapes) like this:

enter image description here

When i click on image i go to this article: enter image description here

but I dont know how to do pager like on this picture that could navigate me to next article: enter image description here

1

You can accomplish this with the contrib module Flippy. It will allow you to add pagers for specific content types. Hope it helps.

Flippy is an ultra-simple module that generates previous/next pagers for content types. On the Node type administration screen, you can turn Flippy on or off for each content type. It'll generate a unique pager for each content type, so you can page through Articles or page through Blog posts, but you can't page through all nodes on the site.

  • I need to go to next article that has a particular taxonomy term. I think i cant do this with this module – Skylar Hunting Oct 16 '19 at 8:28
0

There is often more than one way of solving a problem in Drupal, and this question is the same. It depends on your particular needs which approach you might want to implement.

One option is to make a new View where users would read the articles, they wouldn't be taken to the actual article node page.

You create a new Views Page Display, with a different path. Override the Pager options to only show one article.

Adjust your original Views to link to the newly created Views page, and not the article node paths. You'll need to construct the links of the "articles" in your original views to point to the new Views page with the correct option for the pager page that leads to the specific item. You'll probably be able to do that with the Views Counter field, since it will follow Pager pages predictably.

The Pager in the second Views will be responsible for flicking between individual items.

You have to think about which path/link users see when reading an article. Do you want those to be the node pages or are you happy with one page where only the pager option changes? It affects the SEO of the project so you have to think about it from that standpoint.


A different solution could possibly be created with the use of Views Header and Footer options where you insert the links to previous/next article based on some criteria, possibly with Offset option. I'm not sure about the performance though. If you have a long list and it takes a while to collect all the data from the database it may end up being slow to navigate.

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