Skip to main content
edited title
Link

Views Related Items Block when Taxonomy term is not on URL

Source Link

Views Related Items Block

I have a "Views Related Items Block" problem which I thought was simple but have stopped me dead in my tracks for the last 2 weeks. I have Googled lots and lots of "Drupal Views Related" to no avail and hope someone will be kind enough to help me out.

Here is a sample content node:

TITLE: ABC123 (simple text string)

SHAPE: Square (stored as a taxonomy vocabulary called "Shape" with possible terms of "Square / Circle / Triangle")

COLOR: Red (stored as a taxonomy vocabulary called "Color" with possible terms of "Red / Green / Blue")

I have successfully created a VIEW PAGE configured to display the details of a product item at the URL:

http://www.mysite.com/products/square/abc123

where "square" (as a taxonomy filter) is the shape of the node item and "abc123" is the title of the node.

I would like to create a related items block on this page that will display all items that have the same SHAPE AND COLOR as item "ABC123" (square and red in this case).

I've played with MANY different configurations of "Content: Has taxonomy term ID / Load default filter from node page, that's good for related taxonomy blocks". But it seems like I can only successfully filter for "shape" and not "color". I just don't seem to be able to extract "color" given the above URL path.

I am open to using PHP code filter or even pre_execute() SQL modification, but I have zero experience in doing that in Drupal.

Any help will be most appreciated!

Thanks.

Andrew