Skip to main content
replaced http://civicrm.stackexchange.com/ with https://civicrm.stackexchange.com/
Source Link

Here is the fruit of my journey so far with multiple CiviCRM relationships in Drupal Views.

My original question that sparked this question is here: How to create a drupal 'contact me' link where the user is a contact reference field of Contact B in a civi relationshipHow to create a drupal 'contact me' link where the user is a contact reference field of Contact B in a civi relationship

I wanted to create a landing page for each organisation where my gang has members, so I needed a single Drupal View that would do three things:

  1. Display fields from an organisation (name, logo, motto, website, etc.)

  2. Display a list of members of the organisation (photo, name, etc.)

  3. Link a 'Campus contact' person for the organisation to its Drupal user, so that I could create a 'Contact me' link using the built in Drupal Contact module

With Point 3, the real issue is how to expose the fields of that 'Campus contact' person to the view, so that I could rewrite their name as a link like 'user/[drupal_id]/contact' in order to open a contact form. That is, I needed the Drupal user ID of the Campus contact person.

The basic problem is how to expose the data from three different, but related, CiviCRM contacts in one view.

In my case, the arrangement of the relationships is A->C and B->C. I have two different contacts related to the same organisation each by a different relationship.

For a quick and dirty tutorial for handling a chain of relationships, like A->B->C, e.g. Parent->Child->School, see petednz's answer here: How to create a Drupal View with multiple CiviCRM relationships?How to create a Drupal View with multiple CiviCRM relationships?

If you struggle to connect all those dots because of certain gaps in your understanding of how CiviCRM relationships work, either in Civi itself or in Views, then I recommend you come back to my answer here, as I intend to make the background and logic explicit, before following those instructions. Hopefully, with the information below, you will be able to customise your own views to suit your own specific needs.

Okay. Have to run. I will get around to the answer about 5 hours from now. Hold tight!

Here is the fruit of my journey so far with multiple CiviCRM relationships in Drupal Views.

My original question that sparked this question is here: How to create a drupal 'contact me' link where the user is a contact reference field of Contact B in a civi relationship

I wanted to create a landing page for each organisation where my gang has members, so I needed a single Drupal View that would do three things:

  1. Display fields from an organisation (name, logo, motto, website, etc.)

  2. Display a list of members of the organisation (photo, name, etc.)

  3. Link a 'Campus contact' person for the organisation to its Drupal user, so that I could create a 'Contact me' link using the built in Drupal Contact module

With Point 3, the real issue is how to expose the fields of that 'Campus contact' person to the view, so that I could rewrite their name as a link like 'user/[drupal_id]/contact' in order to open a contact form. That is, I needed the Drupal user ID of the Campus contact person.

The basic problem is how to expose the data from three different, but related, CiviCRM contacts in one view.

In my case, the arrangement of the relationships is A->C and B->C. I have two different contacts related to the same organisation each by a different relationship.

For a quick and dirty tutorial for handling a chain of relationships, like A->B->C, e.g. Parent->Child->School, see petednz's answer here: How to create a Drupal View with multiple CiviCRM relationships?

If you struggle to connect all those dots because of certain gaps in your understanding of how CiviCRM relationships work, either in Civi itself or in Views, then I recommend you come back to my answer here, as I intend to make the background and logic explicit, before following those instructions. Hopefully, with the information below, you will be able to customise your own views to suit your own specific needs.

Okay. Have to run. I will get around to the answer about 5 hours from now. Hold tight!

Here is the fruit of my journey so far with multiple CiviCRM relationships in Drupal Views.

My original question that sparked this question is here: How to create a drupal 'contact me' link where the user is a contact reference field of Contact B in a civi relationship

I wanted to create a landing page for each organisation where my gang has members, so I needed a single Drupal View that would do three things:

  1. Display fields from an organisation (name, logo, motto, website, etc.)

  2. Display a list of members of the organisation (photo, name, etc.)

  3. Link a 'Campus contact' person for the organisation to its Drupal user, so that I could create a 'Contact me' link using the built in Drupal Contact module

With Point 3, the real issue is how to expose the fields of that 'Campus contact' person to the view, so that I could rewrite their name as a link like 'user/[drupal_id]/contact' in order to open a contact form. That is, I needed the Drupal user ID of the Campus contact person.

The basic problem is how to expose the data from three different, but related, CiviCRM contacts in one view.

In my case, the arrangement of the relationships is A->C and B->C. I have two different contacts related to the same organisation each by a different relationship.

For a quick and dirty tutorial for handling a chain of relationships, like A->B->C, e.g. Parent->Child->School, see petednz's answer here: How to create a Drupal View with multiple CiviCRM relationships?

If you struggle to connect all those dots because of certain gaps in your understanding of how CiviCRM relationships work, either in Civi itself or in Views, then I recommend you come back to my answer here, as I intend to make the background and logic explicit, before following those instructions. Hopefully, with the information below, you will be able to customise your own views to suit your own specific needs.

Okay. Have to run. I will get around to the answer about 5 hours from now. Hold tight!

Source Link
Lewis
  • 457
  • 2
  • 10

Managing multiple CiviCRM relationships in a Drupal View: A case study for A->C plus B->C relationships

Here is the fruit of my journey so far with multiple CiviCRM relationships in Drupal Views.

My original question that sparked this question is here: How to create a drupal 'contact me' link where the user is a contact reference field of Contact B in a civi relationship

I wanted to create a landing page for each organisation where my gang has members, so I needed a single Drupal View that would do three things:

  1. Display fields from an organisation (name, logo, motto, website, etc.)

  2. Display a list of members of the organisation (photo, name, etc.)

  3. Link a 'Campus contact' person for the organisation to its Drupal user, so that I could create a 'Contact me' link using the built in Drupal Contact module

With Point 3, the real issue is how to expose the fields of that 'Campus contact' person to the view, so that I could rewrite their name as a link like 'user/[drupal_id]/contact' in order to open a contact form. That is, I needed the Drupal user ID of the Campus contact person.

The basic problem is how to expose the data from three different, but related, CiviCRM contacts in one view.

In my case, the arrangement of the relationships is A->C and B->C. I have two different contacts related to the same organisation each by a different relationship.

For a quick and dirty tutorial for handling a chain of relationships, like A->B->C, e.g. Parent->Child->School, see petednz's answer here: How to create a Drupal View with multiple CiviCRM relationships?

If you struggle to connect all those dots because of certain gaps in your understanding of how CiviCRM relationships work, either in Civi itself or in Views, then I recommend you come back to my answer here, as I intend to make the background and logic explicit, before following those instructions. Hopefully, with the information below, you will be able to customise your own views to suit your own specific needs.

Okay. Have to run. I will get around to the answer about 5 hours from now. Hold tight!