4

I want to create a view with specific nodes. How can I tell views specific node ID's in a list to display?

So for example, I want an unformatted list with node id's 33, 30, and 15.

I tried using the Filter Criteria: Content:NodeID. The problem is that it only allows for numeric value evaluation. It works when i specify using ONE node id. If I add another, it doesn't display anything. If I add another filter using Content:NodeID and specify another node. It also doesn't do anything.

It allows for a regex, but I'm not sure that even with a regex it would allow me to drop in a list of NID's.

5
  • Provide node ids as argument to views. Its simple i think.
    – niksmac
    Commented Aug 14, 2012 at 14:15
  • Yea I tried doing that in the filter criteria... but it didn't work because once you add ANOTHER Node ID. Nothing shows up. Commented Aug 14, 2012 at 14:17
  • depending on what version of drupal you are running, drupal.org/project/viewsphpfilter provides what you are looking for.
    – Jimajamma
    Commented Aug 14, 2012 at 14:29
  • Yea, Sorry I didn't specify. I'm running 7. Just changed the question to reflect that. Commented Aug 14, 2012 at 14:32
  • @Jimajamma Do you know if there is an alternative like Views PHP Filter Or drupal.org/project/views_node_filter But for D7? Commented Aug 14, 2012 at 15:20

1 Answer 1

6

If specific means fixed, you can use fixed value for context filter.

  1. Add contextual filter Content: Nid.
  2. Allow multiple values for this filter in More fieldset.
  3. Input your NIDs as a default value, where + means OR:

enter image description here

In some cases Nodequeue can be useful.

1
  • 2
    Thank You! I tried this... But forgot the multiple values check mark! ::Facepalm:: Commented Aug 14, 2012 at 15:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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