Showing latest news article from taxonomy I have News content type on my Drupal 7. With views I want to show latest news within specific taxonomy. So each News content type has taxonomy field where I can set news for example into "Cars" category.

Now I have News Lift content type where I have entity reference field called news_type that is linked to same taxonomy as is my News content type. When I make a new news lift and I set I want to show post from "Cars" category. On this just created page I want to now show that latest post in that category using views. In Views my current set up is this:

Filters (published &amp; News -content type)
Relationships (Entitry referecing news_type field).

But at the moment it just shows the latest post. It ignores the relationship about the category. What's wrong. Do I  need contextual filter too?
Download the Views PHP module:


  This module allows the admin account (user 1) to add fields, filters
  and sorts to views which use PHP code. It also supports additional
  accounts when the core PHP Filter module is enabled.


In Views:


create a View of News Content Type, as a block and set it up to show all entries for now in the format and layout you desire
add a contextual filter for the Category field
Provide a default value, PHP code:

$node = menu_get_object();
return $node-&gt;field_category['und'][0]['tid'];



The first line retrieves the page object (which should only ever be a News Lift node if the block is set up properly), then returns the term ID associated to the current node as a contextual filter to the view. This assumes a single language site.


Under /admin/structure/block set the view-block to show where you want on the page, limit it to show only on the content type News Lift