2

I have made a view block to show on each node for recommending other node of similar interest type.

Every node have a field called Main Category, which is taxonomy.

I want to show those node title which has similar category where view block is attached(I mean at node page).

Note - I have attached view block into node by EVA field.

1
  • "the unique ID of the entity the view is attached to -- as well as any tokens generated from that entity -- can be passed in as arguments to the view." - so, have you tried to set up arguments? What problem with it do you have?
    – Mołot
    Commented Jul 19, 2013 at 7:20

1 Answer 1

4

There is a module for that: Similar by Terms

However, it's possible with views as well: Creating list of similar nodes in Drupal 7/Views 3

Alternatively, you can use my configuration:

An example of view block with related nodes based on 'tags'.

  1. Create a block (take a look at screenshots below)
  2. Add a relationship: Taxonomy term: Content using: Tags
  3. Add contextual filter: (field_tags) Content: Nid

    When the filter value is NOT available
    Provide default value -> Content ID from URL

    MORE
    check: Exclude
    this contextual filter will remove current node from the view
  4. Add contextual filter: Taxonomy term: Term ID

    When the filter value is NOT available
    Provide default value -> Taxonomy term ID from URL
    check: Load default filter from term page
    check: Load default filter from node page, that's good for related taxonomy blocks
    choose the vocabulary (tags in this case)
    Multiple-value handling -> Filter to items that share any term

    When the filter value IS available or a default is provided
    Specify validation criteria -> Basic validation

    MORE
    check: Allow multiple values

  5. Define the fields (only titles in this case)

  6. Make the view display only distinct items

    Other -> Query settings:
    check: Distinct
    check: Pure distinct


Screenshots:

enter image description here enter image description here enter image description here enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.