Hello,

I haven't been able to figure out to do this yet, maybe it's not possible and this is a feature request? I'm not sure.

Right now when you add a Node > NID filter in a View you have the following options

Is less than, Is less than or equal to, Is equal to, Is not equal to, Is greater than or equal to, Is greater than, Is between, Is not between.

I tried selecting "Is equal to" and typing 111, 242, 391 in the Value box. I also tried separating NIDs with +. Views will only take the first NID value and filter off of that.

Is there a way to have a filter for NIDs similar to the "Is one of" option on the taxonomy term filter?

Thanks for reading!
-Tim

Comments

merlinofchaos’s picture

Status: Active » Fixed

It is only possible to filter for multiple nids when using an argument.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Sinan Erdem’s picture

If anyone needs to use multiple nid's for filtering, I have done it like this:

Instead of nid filter, I added an argument Node:nid.
Provide default argument: Fixed entry
Add the nids with plus. For example: 1+3+5
Checked: Allow multiple terms per argument.

Now it only shows nodes 1, 3 and 5...

agnez’s picture

Hey etcetera9,
nice that you posted the solution here after such a long time. It was just the information I needed.
Could you also tell how to obtain "Is not one of" ? I tried !1+3+5 and !1+!3+!5 but that didn't do the trick...
cheers
ag

Sinan Erdem’s picture

I don't think exclamation mark (!) works on these. Instead you can try selecting the option "Exclude the argument" at the bottom of the argument settings.

agnez’s picture

yes that works, thanks

drupaluser_test’s picture

Hi,

I am using drupal 7. In my views block I have 100 contents. In that 100 contents I want to display only 10 contents. I have to select that 10 contents. I can not add multiple nid in filter criteria. How can I add more than one nid in content:nid filter criteria?

Do you have any Idea?

Sinan Erdem’s picture

Look at comment #3.

mandus.cz’s picture

This does not work on the exposed filter. Does Anyone know a solution to this?

dr.osd’s picture

In the views 7.x-3.7 it is easy: you can add multiplie nid filter and then combine them to group with "or" or "and" operator.

web226’s picture

Issue summary: View changes

Thanks, as per comments #3 and #5, using arguments to filter out specific nid's worked for me on

icf-vpathak’s picture

Comment #3 worked!!
Thank you