I have a content type "book" that has an entity reference field that references users and pulls in a name. Users also has fields for a picture and an author website.

I would like to add a block at the bottom of each book node that shows the author picture and website.

What is the correct way to set up the relatioknship and filter when there is no user ID in the URL?

1 Answer 1

  1. Set up the relationship. Under the Relationships section click + to add a relationship.

    • Under "Add relationships" you will see all fields listed.
    • Drop down the Groups menu and select "Content".
    • Locate your node reference field, for example 'Content: Reference user (field_reference_user)'. Check the box to the left of it.
    • Click the Add button.
    • Check the box labeled 'Require this relationship', and click the Update button.
  2. Add a Contextual filter for Node ID. Set the default value -> get ID from URL

  3. Add a field. Click + next to Fields. Under Groups, select Node, and choose Node: Title. Under Relationship, select your node reference field, e.g., Reference user, click Update.

Create a view on a node reference field will explain you in detail

  • Thanks you. But there is no ID in the URL... Doesn't that matter?
    – Baybook
    Commented Dec 3, 2014 at 13:26
  • if it's node page then the URL would be node/nid.. Even if you use path alias.. arg(1) will be nid. Commented Dec 3, 2014 at 13:29
  • Yes, but the node iD does not related to the user ID? I will try. Maybe that's my problem. I am expectuing there to be a relationship beyween the user ID and the selection I am making in the arguments
    – Baybook
    Commented Dec 3, 2014 at 16:09
  • And actually, Node is isn't an option with a view or users. :)
    – Baybook
    Commented Dec 3, 2014 at 16:16

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.