Score:1

How to display all data from a paragraph field in views (Drupal 7)

ae flag

I am currently a caretaker for a Drupal 7 website and I can't figure out how to group paragraph items in views. I have created a content type Products and one of the fields is called product variation which is field type paragraphs. I have created a paragraph bundle for that field.

Then I created a view to show the products on the front page. To display the paragraph fields I created a content relationship. When I open the relationship option and select delta to display one it only shows one and I can't get data from the others. If I select delta to display all it shows like in the image below (Current view displays like). The goal is shown on the same image. Could someone help me solve this: enter image description here

I am currently a caretaker for a Drupal 7 website and I can't figure out how to group paragraph items in views. I have created a content type Products and one of the fields is called product variation which is field type paragraphs. I have created a paragraph bundle for that field.

Then I created a view to show the products on the front page. To display the paragraph fields I created a content relationship. When I open the relationship option and select delta to display one it only shows one and I can't get data from the others. If I select delta to display all it shows like in the image below (Current view displays like). The goal is shown on the same image. Could someone help me solve this:

My setup on the fields I want to display in the view are setup like this

`content-type: Products
 product name - field type: Node module element
 proudct image - field type: Image
 product variation - field type: paragraph
 paragraph bundle: product variations
                   color (Term reference)

 view:
 Display: product name, product image,product variation
 Relationship: Content: product variation (field_product_variation)`

Hopefully, someone can help me solve this problem.

leymannx avatar
ne flag
Consider adding a new view mode to the node and the paragraphs where you display the fields just like you want. And in the view then display the full node in a certain view mode instead of dragging fields around in the view.
ae flag
@leymannx I don't understand what you mean with adding a new view mode. Could you explain little more in detail.
leymannx avatar
ne flag
You can use Views to display either fields (not so good in the long run) or to simply display full entities in a certain view mode (teaser, full etc.). You can add your own view modes to entities (nodes, paragraphs etc.) for your own purposes so that when they are displayed in whatever context you just get the stuff you want and you can use normal node or paragraphs templates to adjust them. So in your view you probably display the node in a certain view mode (maybe 'my_own_teaser'), while this view mode displays the paragraphs in their own certain view mode (maybe also 'my_own_teaser').
ae flag
ok, I will give it a go.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.