0

I have view1 and view2, when I click on the node link of view1 say

ex: id [mc] it should get view2 and display corresponding information like strain , projects etc based on the id[mc].

So far to get the view2 while clicking on view1 node, I have performed following,

  • In view1 I have rewritten the tittle[node] output to link and specified the path of view2.

  • Given contextual filter to filter and to get the related field value of view2.

Problem is when I click on particular node of view1 it gives the view2 but it is not filtering based on the node we have clicked.

So can you please tell me how to filter and get the field values of view2.

enter image description here

10
  • 1
    what are you using as your contextual filter?
    – No Sssweat
    Nov 5, 2015 at 7:08
  • @NoSssweat: Thanks for replying me.... i am using entity reference field of view2 [ its referring the nid of view1]
    – neethu
    Nov 5, 2015 at 7:10
  • 1
    can you post a screenshot of your view's Advanced settings
    – No Sssweat
    Nov 5, 2015 at 7:12
  • 1
    so let me get this straight. So you have view1 which shows up in /node/1. View1 has a link to /node/2. Node2 has a view2 which shows fields from Node2?
    – No Sssweat
    Nov 5, 2015 at 7:23
  • 1
    yea, lets chat here chat.stackexchange.com/rooms/35445/neethu
    – No Sssweat
    Feb 8, 2016 at 12:00

1 Answer 1

1

Step 1)

I added a Entity Reference field called 111 to my Content Type

enter image description here

Step 2)

In view1 in RELATIONSHIPS click Add

  • in search type ref
  • select Entity Reference: Referenced Entity

enter image description here

Step 3)

In FIELDS click add, select File Usage: Entity ID.

  • Under Relationship, select your entity reference
  • check mark exclude from display.
  • Thousand Marker, select none

enter image description here

Step 4)

Move your title field below the File Usage: Entity ID field.

enter image description here

Step 5)

Click on your Title field.

  • Uncheck link this title to the original piece of content
  • Under Rewrite results, checkmark output this field as a link
  • link path: /view2/[id]

enter image description here

Save view1

Open View 2

Step 1)

Add a Contextual Filter of File Usage: Entity ID (Do the same as picture below)

enter image description here

Step 2)

In RELATIONSHIPS click Add

  • in search type ref
  • select Entity Reference: Referenced Entity

enter image description here

Step 3)

Change the page path settings to /view2/%

enter image description here

DONE :)

Your Answer

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

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