Score:0

How do I set up a views block that filters contextually on a field included in a paragraph?

in flag

I have two content types (ContentA, ContentB) which both use the same paragraph (MyParagraph) as field type “Entity reference revisions.”

MyParagraph consists of two “List (text)” fields: ParagraphFieldA, ParagraphFieldB.

The values for ParagraphFieldA and ParagraphFieldB come in both cases from allowed values lists which have a key and label.

ContentA is limited to one MyParagraph reference but ContentB can have multiple MyParagraph references.

I have been trying to set up a Views Block that will be shown with any ContentA node. I want it to list titles of all ContentB nodes that have the same ParagraphFieldA value as the ContentA node.

I have a Views Block with Fields: Content: Title; and Filter Criteria: Content: Content type (=ContentB).

It has relationships to Paragraph referenced from MyParagraph and Content using MyParagraph.

I have added a contextual filter to (MyParagraph: Paragraph) Paragraph: ParagraphFieldA with “Content ID from URL” selected under “Provide default value.” I expected this to filter on the ParagraphFieldA value from the displayed ContentA node, but no results are returned.

If I put a key value from ParagraphFieldA in the preview box, I get a list of the relevant ContentB titles, but the view is not getting this automatically from the URL.

I have searched high and low for a solution and have tried various permutations without success. Clearly I am making a basic mistake here but I can’t see what it is.

Can anyone help?

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.