Skip to main content

Drupal: How to create a View that shows results only from the current node

Let's say you want to create a Views block that shows on a bunch of different pages/nodes that have multiple (imagefield) images per page, and you want the block to dynamically display ONLY the images from the particular node you're on--and not display images from other nodes.

This is how you would do it:

1. Create your view as you normally would.
2. Add "Node: Nid" under "Arguments".
3. Select "Provide Default Argument" under "Action to take if argument is not present:"
4. Select "Node ID from URL" under "Default argument type:"
5. Leave everything else as is...
6. Hit "Update" and then "Save"... and you're done.

Comments

Thanks

Thank you for that!

thanks dude

thanks dude

thanks dude

thanks dude

Thanks for the the post! That

Thanks for the the post! That was Hilarious!!

Nmhdheeslbcdahtthr

Nmhdheeslbcdahtthr ejdwvyyacoo

Thank you! That was exactly

Thank you! That was exactly what I was looking for! :)
What if I wanted to show the view inside the node? As I understand it it should be possible using views attach but I can't quite understand how it works…

this works well, but what if

this works well, but what if you have automatic alias turned on. I tried using Node: title but it doesn't take into account the directory path.

Thank you this worked for me!

Thank you this worked for me!

awdfsf

awdfsf

Post new comment

The content of this field is kept private and will not be shown publicly.