0
votes

I have a event_note node that contains body text and a node reference to associate the note to event nodes. How would I create a View that grabs the event_note that has the node id referenced.

So let's say event_note references node 4 and 20. In my view, I want it so that the argument is 4 or 20 and I want it to find the event_note that referenced it.

1

1 Answers

0
votes

Try this:

  1. Create a new view (with node as type).

  2. Add -> Display -> Page

  3. Add field -> Node Title (click override default display)

  4. In path settings add Path : node/%/evet_notes and in Menu: select Type as Menu Tab and give one title eg: Event notes.

  5. In the argument section do the following (first click override default display)

    1. Add this argument: the content you used in event_note node to reference event node.

    2. Under "Action to take if argument is not present: " select "Provide default argument".

    3. In "Provide default argument options: " select "Node ID from url"

    4. Under "Validator options" select "Node" and check "Event" as the node type.

    5. Finally click update.

  6. Save the view.

  7. In the live preview choose the page display and give arguments as 4 or 20, it will list the event_note nodes referring the node 4.

  8. Now go to any event node page, you will see a new menu tab "Event notes", click on it. This will display all the event_note nodes referring the corresponding event node.