I just can't get my head around the following problem.

  • I have two content types. One is ISSUE the other one is ARTICLE.
  • I use the Node Reference module to link and ARTICLE to an ISSUE.
  • Then I am using Free Pager module to have a pager on every page to click to the next and previous node.

The pager works but for all ARTICLES of all ISSUES. Now I want it to work for only the ARTICLES in the same ISSUE as the current node.

I tried to get this to work with the normal Views filter and the Contextual filter but for some reason it doesn't work. Does anyone have a solution for this? Or another option with other modules that do the trick?

Thanks in advance Joost

  • it should work easily in Views with a simple exposed filter - are you using the reference field in Article or Issue to link the two? what filter criterion are you using for the filter?
    – Geoff
    Apr 30 '15 at 16:07
  • Hi, I'm using the Reference Node in Article to link the two. I'm filtering on Content Type [Article] and Published [Yes].
    – Joost
    May 1 '15 at 7:19

It can be done using Views:

  • set up the view in the format you want so that all Articles show
  • create a filter on the Node Reference Field in Content:Articles
  • expose this filter
  • make the operator: Is one of
  • Options: Select all - this should automatically update as new issues are created

  • Pager: Mini, Mini pager, 1 item - this will create a simple pager with only one item per page

  • Hi Geoff, thanks! But I don't want the filter to be exposed it should automatically filter/show the nodes that have the same related node as the current node.
    – Joost
    May 1 '15 at 17:54
  • then change that to a contextual filter, the principle remains the same... otherwise you would need to get into session variables and a custom module I think
    – Geoff
    May 1 '15 at 17:58
  • Okay, this is an option but changes my complete way of how my site works. This way I'm making a view with a pager. But I want to show a node with a pager block. How is this possible?
    – Joost
    May 4 '15 at 11:27
  • with a custom module, that will essentially do what Views is doing in my answer
    – Geoff
    May 4 '15 at 12:14
  • Thanks, so a custom module, I'll see if I can figure out how. Never made one but I'll try my best.
    – Joost
    May 4 '15 at 21:05

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.