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 candorem_andy on
My experience with Drupal 8 is limited and I am stumbling with something that I would have thought would have been fairly easy.
Anyway, here is the situation.
I have a 'product' content type. There are 3 fields in this content type to select a 'related product' with an content entity reference field.
Now I am trying to create a block view that pulls in and displays a title, image and path of those select products into the product page that they were selected to.
My issue is that I cannot seem to pull in the products that were selected in these fields.
Comments
~
We are going to need more info on how you setup your view. Is your contextual filter in place for the content id?
Ya, I did that and then set
Ya, I did that and then set up a relationship with Content referenced from field_related_product_1.
Can you post a screenshot of
Can you post a screenshot of your contextual filter content:nid settings?
https://imgur.com/aYeR42q
https://imgur.com/aYeR42q
~
Take out the relationship in you contextual filter. It should only be in the relationships section and then added to your field settings.
It is displaying the product
It is displaying the product that the related products are selected in, but not the related products.
Here are my settings, I apologize, I'm new to Drupal.
https://imgur.com/v7DdVDS
I am not totally following
I am not totally following you. Also, I am not sure of your setup and why you have 3 separate fields for adding related products. Usually this is done with one field with multivalue settings.
If your site is publicly available (and you feel comfortable doing so) send me a PM on my drupal.org account page with a URL and login info so I can see what you have going on in the backend.
Product A has 3 fields that
Product A has 3 fields that can be selected for related products. Products b,c,d are currently chosen as related products for Product A. (I can make it one field with multi-values, but at this point I'm just looking for the output I need). With the setup you see from the previous image, the output is giving my product A instead of b,c,d.
~
You need to actualy add the product b,c and d fields in your field settings in your view on the left hand side. Remove the exisiting field you have there as it will show only product a.
Thank you so much. I was
Thank you so much. I was thinking about the output wrong and it totally had me confused. Again, thank you!