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_container 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!

enter image description here

  • Can you post screenshot of your formatter settings? – No Sssweat Dec 31 '18 at 13:07
  • @NoSssweat Sure, see above ;) – R. Schleutker Dec 31 '18 at 13:23
  • Why are you using views for this? When your setup is node -> panel_container -> panel, you can just render them as ordinary multivalue fields. – Hudri Dec 31 '18 at 13:24
  • Try checking the multiple checkbox. – No Sssweat Dec 31 '18 at 13:26
  • 1
    I think your logic is one level "to deep". The panel container field should be displayed as a view. The contextual filter should use the "Parent ID". – Hudri Dec 31 '18 at 13:42

Your Answer

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

Browse other questions tagged or ask your own question.