I am creating a view block to be displayed on every page of a specific content-type. Among other things, this view shows a field from that content type. How can I configure the view so that it will only display the field data from the page it is on? Right now it shows the data from every instance of that content-type field. Is there a way to reference the 'parent' page only?

  • 1
    You can use the contextual filters option in the advanced section. – sareed Dec 22 '14 at 20:38

You van do this with a contextual filter on your block view.

There is a very gold tutorial located here: http://dannyenglander.com/blog/using-views-contextual-filters-create-related-content-block-drupal-7

If anything is unclear dont hesitate to ask! ;-)

  • 1
    Thanks for the example! Using a contextual filter on Content:Nid is exactly what I needed. – digitgopher Dec 22 '14 at 22:44

Add a contextual filter on your block view for Node Id. Then Under "When the filter value is NOT available", select Provide default value and choose in the select list, Content ID from URL.

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.