1

I used contextual filters before and I know they are just like the normal filters but more dynamic, now I have this view "Sidebar Product advert block" that needs to show the product advert ( Similar to product teaser! advert is a view mode ) BUT only if the product is referenced in the field_product_teaser in the article data type. So to be more clear:


Articles have a reference entity (Autocomplete) field_product_teaser.

Products referenced in this field should appear in the sidebar!

So the condition is {{ product.Product-id == article.field_product_teaser }}


I hope that was clear enough, what should I use in this case ?? contextual filters? relationships? I tried using both with no luck!

0

You should use the contextual filter to identify the article the block is being displayed on. E.g. content id from URL should work.

Then you should use the relationship option to link the field_product_teaser info to products. E.g. Content referenced from field ....

Then in the view, you can select the product fields you want to display and use the reference to tell views what you want displayed. E.g. title w/ product reference relationship = product title.

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.