Hi, i am a newbie of everything, so your help is appreciated a lot. I have gone through all the tutorials and screencasts I found, but this seems a little advanced.
I am trying to build a bookstore. I am simply trying to make a block view that displays 'other books of this author'.
I have a book product entity. Authors are taxonomy terms and product entities are tagged with them. I have a book product display node. The view is gonna be a block on this node.
The referencing flow should simply be:
Current node -> Referenced product entity from current node -> Tagged product entities with the same term -> Product display nodes referencing these entities
So I need to create a contextual filter (which is not very easy on the block view) that takes the product via relationship but then finds its author.
Any help is appreciated a lot. Thanks in advance.
Comments
Comment #1
rszrama commentedI don't remember the precise configuration, but it's not that difficult to get a block pulling the nid from the URL since you know that every node uses the URL structure of node/%nid. Once you have the node, then you'd add a relationship to the referenced product, and from there you'd be able to use its term as a filter. (You might need to add another relationship to the referenced terms... can't remember how that integration works.) Once you've filtered your products View to those referenced products, you're going to want to add a reverse product reference relationship (i.e. Nodes referencing this product) so you can get the title / link for the actual View results.
I don't have time to go through this, but perhaps you can take this description to #drupal-views or #drupal-commerce and have someone walk you through parts you don't understand (or I got wrong ; ). If you solve it, we'd love to see the results here.
Comment #2
durum commentedThanks for the time, Ryan.
I was sure I tried this before, but this time it happened to be successful.
I am getting the node id as contextual filter.
I have these relationships:
- referenced product entity (as product entity)
- (product entity) Commerce Product: Author (field_author)
- (term from field_author) Taxonomy term: Commerce Product using Author
- (field_author) Commerce Product: Node referencing products from field_book
Export of view looks like this:
Comment #3
rszrama commentedGreat, thanks for sharing! : )