1

Trying to create a view (a block) with associated products on product pages. Products have a field "Related products" (Entity Reference) and in my view (show products' fields) I can get images and titles of them using contextual filter (Content: Nid) and relationship (Entity Reference: Related products). But there's a problem with the url of titles and images, they're leading to editing pages (like admin/commerce/products/1), but not to content. I tried to add a field Content:Path, but I get a link to a product itself, not to related with it products.

0

As you're creating your view, you need one more relationship. Look for this relationship:

Commerce Product: Referencing Node

(Relate a product to the Node referencing it through field_product.)

This will allow you to harness the "reverse-relationship" going from the product to the reverse-node. Add this relationship, require it, and then use this to generate your links.

  • Don't know how could I miss this relationship. It works! Thank you, nvahalik! – Grace Dec 18 '15 at 17:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.