Score:0

How do I prevent filtering of parent when adding a filter to a relationship?

be flag

I have a view of users which includes a relationship to a multi-value paragraph field. I’m adding a filter to the paragraph if field_current is set to true, to show only the current paragraph. But the side effect of this is that users are not included in the view if a current paragraph doesn't exist.

Is there any way to avoid filtering out the users, and just show empty fields if there isn't a current paragraph?

sonfd avatar
in flag
I would build a field formatter that only shows child paragraphs when the checkbox is checked. Then I would just build a normal view and set that field to use my formatter - no relationship needed.
Chris avatar
be flag
You mean using this module? https://www.drupal.org/project/views_field_formatter Does it play well with data export?
Chris avatar
be flag
Oh I think you mean a custom formatter like this https://www.drupal.org/docs/creating-custom-modules/creating-custom-field-types-widgets-and-formatters/create-a-custom-field-formatter - think this could work, thanks!
Chris avatar
be flag
It works! If you add an answer I'll accept it :)
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.