Score:-2

Relate each node with multiple fields set to the node

in flag

I am trying to create a view that displays how many times each child has been related to parents through multiple fields.

Assuming we have two parents (Simple Parent and Extended Parent), and three children (Red child, Blue child, Green child), the parents have two field types (field_children, field_morechildren) that relates to multiple child entity references.

If the content is set like this.

  • Simple Parent

    • field_children: Red Child, Blue Child
  • Extended Parent

    • field_children: Red Child
    • field_morechildren: Red Child

I can sort easily with two relationships and two fields added to my view.

Child field_children field_morechildren
Green child 0 0
Blue child 1 0
Red child 2 1

I want to display the sum of each fields result.

Child Total
Green child 0
Blue child 1
Red child 3

How should I proceed?

cn flag
See https://www.drupal.org/project/entity_usage_views_field, it may well do what you’re asking for out of the box
in flag
- is it possible to sort the results by entity usage count? - is it safe/reliable to use this module? (very few people use this module. plus the download area on the website is yellow, not green)
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.