I’ve got a question that is a worry to me. So what do I want to do?
I’m using drupal 8 with the paragraphs module. I want the content creators to be able to add an unlimited number of paragraphs that are presented as a grid view on the website.
For this I’ve created a paragraphs type called “panel” with a text and image field. I’ve also created a view of these paragraphs. So far so good. I can show all the panel paragraphs in a pleasant way.
I’ve then created a container paragraph called “panel_container” the only field of which is an unlimited number of “panel”. So the idea is that the content creators add a new paragraph of type panel_container to a node and then create an unlimited number of “panel” paragraphs within this container paragraph. No comes the tricky part: How to show only those panels that belong to the respective panel_view paragraph.
For this I’ve installed the views field formatter module. This allowed me to choose Views as the field formatter for “panel” in “panel_container” and selecting the View I’ve created for the panel paragraphs type. Without any contextual filter this of course shows ALL “panel” paragraphs wherever a “panel_container” paragraph is inserted.
SO how do i show only those “panel”s that belong to the respective “panel_container”? I’ve selected entity ID for the views field formatter, which seems to hand over the entity ID of the respective “panel_container” to the view. Adding a “Paragraph: ID” contextual filter indeed restricts the result for the view to the “panel” that belongs to the “panel_container” which is pretty much what I want. The problem is that it shows the FIRST “panel” only eventhough several “panel”s where added to the “panel_container”.
I’ve tried to fix that for some hours now but it appears that I’m simply not skilled enough… So does someone has a useful idea?
Thanks a lot in advance!