Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By kenpeter on
Hi,
* I have 2 content types: "book" & "author"
* In both content types, we have a dropdown called "category".
* e.g.
- A book has a category called "science".
- An author has a category called "science" as well.
- My query 1: I have an actual book (under "science") and I want to pull all authors (under "science").
- My query 2: Similarly, I have an author (under "science") and I want to pull all books (under "science").
- How do I do that?
Comments
You can use views, in this
You can use views, in this case you will want two views, one listing books, the other authors.
In both cases you will want
You can either use block displays, or use eva and attached fields to the content types.
* I have a view
* I have a view "authors_under_book" (this lists all authors, if I type book node id in the url)
* I have "node id" set up in the view only, so I can see what are going to displayed.
* Filter criteria: I make it as "author" content type, because that is the only thing I want to see now.
* Context filter: I did what you said, which is the node id form url.
* Content: Taxonomy terms on node, I did that as well. I have my "category" entered.
* It is not working.
* When I enter book node id, it shows nothing.
* When I enter author node id, it just shows the author node id.
Are you showing nodes or
Are you showing nodes or fields? Is the relationship being used to display information?
Hi, * I am going to show the
Hi,
* I am going to show the fields of author.
* Currently, I set it to node id of author, so I can see whether it is working correctly or not.
* I am a bit confused with the relationship.
* In sql,
- book id --> category id --> author ids (book and author share the same category)
- How do I do it in view, what I did to the relationship is to select "category" taxonomy. Is it enough?
For each field you display
For each field you display there is a setting for the relationship to use, you want the fields to use the relationship you added.
Hi, * I am sorry. I don't
Hi,
* I am sorry. I don't understand it. (I guess I need specific steps)
* That is my current set up --> http://i.troll.ws/e42708c7.png
* Slightly different, but it is to list profiles under one program.
* I also came across this article --> http://scito.ch/content/show-related-nodes-block-based-taxonomy-terms-vi...
Under fields you are not
Under fields you are not using the relationship.
Configure each field, toward the top of the form will be a drop down that allows you to specify the relationship to use.
* I am sorry, I don't think I
* I am sorry, I don't think I see the relationship any way.
* Is it under "sturcture" of the admin menu?
* Do you may to post a screenshot?
Hi, *
Hi,
* http://drewish.com/node/127
* I just watch this video, it seems there is a relationship drop down in each field. This is view 2.
* I am using view 3 and I didn't see this. (I may miss some here)
Ok, I have sent you down a
Ok, I have sent you down a bad path, I can not recreate what I had done earlier so it means I left out a step (which I can not recall off the top of my head). But I did find this comparison of modules that might help: http://drupal.org/node/323329. Similar Terms looks like a possibility and has views support.