Feature: Related Blocks

Modules:
None

Functionality:
This block displays the content that is related to the main article displayed on the page
The relatedness of content in this context, is determined by the presence of same taxonomy term and tags in different articles, i.e. if articles matches at least one of their category taxonomy terms AND at least one from the tag taxonomy term, we term the articles related

Implementation:
Create a view, and add all the fields intended to be displayed
Add the fields tags and taxonomy term under relationships
Under the Contextual filters add the two fields taxonomy term and tags, and use the relationship defined before
Use ‘Provide default value’ under ‘when filter value not available’
Choose ‘Taxonomy term id from URL’ under type
Check load default filter from node page and limit term from vocabulary

Choose the vocabulary expected from the list displayed
Check ‘Filter to items that share any item’

Under ‘More’, check ‘Allow multiple values’

Similar configuration should be done for the tags field

The next contextual filter is the ID. This filter is to ensure the removal of the main article from the related block.
Check provide default value, and select ‘Content ID from URL’

Under ‘More’, select exclude from display

To avoid, duplicates in the related block, enable the aggregator settings under ‘Other’ in ‘Advanced’
If the body field is used in display, and it shows HTML tags check the format option under the aggregator settings for the body field.

Comments

VM’s picture

good work.

documentation/tutorials/work instructions are better served in the documentation section of drupal.org.