I have a slightly complicated question. So i'm experimenting with nested paragraphs where the parent paragraph is a container for another paragraph. In this case, i'm making an Agenda/Event program where the parent container is the 'agenda' paragraph type and the children are basically just rows created by an 'agenda-row' paragraph type. The Agenda paragraph type has a field reference that references the child paragraph.

All of the above is working fine and as expected, however, now I've created an 'Events' content type. The event content type has another entity reference field where you can only choose the 'Agenda' paragraph type and then you fill in the agenda information using it's child paragraphs. From here what I would like to do is create a View block of the 'agenda' and have the block contextually filtered by the event node it's attached to. I have not for the life of me been able to get this working and i'm hoping someone has some experience with this!

What I've tried:

Current model: Changed the display of the 'Agenda' paragraph type to display the View block instead of the content field.

Various Changes:

  • Set the View contextual filter to ID and "Provide default value" of content ID
  • Set relationship of the view to be "Relate each Content with a field_event_agenda_program set to the paragraph."
  • Set the View contexual filter to default
  • Changed the display of the 'Agenda' reference field in 'Events' to hidden and manually added the View block to the Events content type.
  • Tried various ways of filtering the View block with "Target ID" of the paragraph
  • It would help if we knew what you've tried. The "Content: Id" contextual filter should work here; if not, I think more information is needed. – othermachines Oct 8 '19 at 14:58
  • @othermachines Sorry, you're right. I've updated the original post with some additional information. – ovp Oct 8 '19 at 15:17
  • Unless I'm misunderstanding, all you should need is the Content: ID contextual filter. No relationship is needed. Just filter the view by your Event content type and display your entity reference field under Fields. – othermachines Oct 8 '19 at 17:51

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.