I have found the Vikas and he is amazing developer, he had always delivered the product under the timeline, on budget and with 100% accuracy, He is totally problem solving guys.
Display similar content type nodes as current node
comments |
In this blog, we are going to explore the trick about how to display all nodes of same content type as the current node using Views.
We can use contextual filter to get this structure with Views.
Let's follow the following simple steps to achieve it:---
- Create a block view for any content type which listing you want to show.
- Format: no any special setting.
- Expand the 'Advanced' options on the right side and Click 'Add' next to 'Contextual Filters'.
- Enter 'Type' in the search box filtering the results to just 'Content: Type' then check this box and click 'Apply (all displays)' button.
- Click on 'Provide default value' next to When the filter value is NOT available
- Select PHP code under Type and enter below code under PHP contextual filter code
$node = node_load(arg(1)); return $node->type;
- click 'Apply (all displays)' button.
- Now assign this views on any page and check your result.
Add new comment