Answers.Body: <p>It is correct that not all fields from the CiviCRM RelationshipType entity are available in the the views by default. The socialistic party in the Netherlands had the same problem. And I created a drupal module for them to fix this. </p>
  
  <p>You can find the module at <a href="https://github.com/SPnl/nl.sp.drupal-civicrm-views-enhancement" rel="nofollow">https://github.com/SPnl/nl.sp.drupal-civicrm-views-enhancement</a></p>
  
  <p>This module adds the name-a-b, label-a-b, name-b-a, label-b-a, contact-type-a, contact-type-b, contact-sub-type-a, contact-sub-type-b, description, is-reserved, is-active to drupal views.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-02T19:02:05.487Z
Answers.Text: Sounds great Jaap - what chance of this getting provided back to core as a patch?
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-02T19:04:40.430Z
Answers.Text: I don't have a plan to do that. However feel free to reuse the code for a core patch.
Answers.UserDisplayName: Jaap Jansma - CiviCooP
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-02T19:26:02.160Z
Answers.Text: @petednz-fuzion, this fixed it for me, but I'd be interested in taking my coding skills up a notch and learning how to patch this in so others can benefit.  Where would this code need to go for a patch?  Into Civi Core (where?), the CiviCRM_Entity module, or some other place?  I'm willing to do the work, just need a little direction. :)
Answers.UserDisplayName: Allen Hutchison
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-02T21:11:39.557Z
Answers.Text: The first thing you have to do is to report this as an issue in the issue tracker at https://issues.civicrm.org Then you have to set up a local development environment. I have written a blog on how to do that: http://jaapjansma.nl/2015/08/25/howto-setup-a-civicrm-development-environment-for-fixing-bugs/ after you have done so you could start fixing the bug. This bug should probably be fixed in the civicrm-drupal project on github: https://github.com/civicrm/civicrm-drupal
Answers.UserDisplayName: Jaap Jansma - CiviCooP
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-04T06:13:02.710Z
Answers.Text: Thank you @JaapJansma!  This will be a great project for me.
Answers.UserDisplayName: Allen Hutchison
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-24T06:59:44.563Z
Answers.Text: Note for myself -- look at line 2182ff in https://github.com/civicrm/civicrm-drupal/blob/7.x-master/modules/views/components/civicrm.core.inc for originally included fields, format examples and probable place to include fixed code.
Answers.UserDisplayName: Allen Hutchison
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-02T09:57:04.410Z
Answers.LastActivityDate: 2015-12-02T09:57:04.410Z
Answers.UserDisplayName: Jaap Jansma - CiviCooP
Body: <p>I'm creating blocks to show a Drupal user's relationships on their user page. I've been able to create the views necessary to show the Display Names of the contacts in both the user's A to B relationships and of B to A relationships.  I'd like to display the name of the relationship as well for each contact. <strong>There is a Views Field for Relationship Type A-to-B, but I can't find a Relationship Type B-to-A field. Any ideas?</strong> If one does not exist or cannot be created by tweaking something in the Views UI, how would I go about creating the field in code?</p>
  
  <p>Drupal 7.41, CiviCRM 4.6.6, CiviCRM_Entity module 2.x</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-12-02T04:46:08.333Z
Comments.Text: Agree it looks like it doesn't exist and can't be 'influenced' by applying the relationship to that field. You could see if starting with a View based on Relationships doesn't trip you up somewhere else. I will fire this off at Torrance and see if he can give you a quick 'how to' for patching this.
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-12-02T07:33:41.323Z
Comments.Text: Thank you Pete, that would be great and much appreciated!
Comments.UserDisplayName: Allen Hutchison
Tags: <drupal><drupal-views><relationships>
Title: Drupal Views Field: Relationship Type B-to-A?
ThreadText: # Drupal Views Field: Relationship Type B-to-A?
  
  (Asked by: username_0 on 2015-12-02)
  
  I'm creating blocks to show a Drupal user's relationships on their user page. I've been able to create the views necessary to show the Display Names of the contacts in both the user's A to B relationships and of B to A relationships. I'd like to display the name of the relationship as well for each contact. **There is a Views Field for Relationship Type A-to-B, but I can't find a Relationship Type B-to-A field. Any ideas?** If one does not exist or cannot be created by tweaking something in the Views UI, how would I go about creating the field in code?
  
  Drupal 7.41, CiviCRM 4.6.6, CiviCRM\_Entity module 2.x
  
  **Tags:** drupal, drupal-views, relationships
  
  > **Comments:**
  > **username_1**: Agree it looks like it doesn't exist and can't be 'influenced' by applying the relationship to that field. You could see if starting with a View based on Relationships doesn't trip you up somewhere else. I will fire this off at Torrance and see if he can give you a quick 'how to' for patching this.  
  > **username_0**: Thank you Pete, that would be great and much appreciated!  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2015-12-02. Score: 3 | Accepted answer
  
  It is correct that not all fields from the CiviCRM RelationshipType entity are available in the the views by default. The socialistic party in the Netherlands had the same problem. And I created a drupal module for them to fix this.
  
  You can find the module at <https://github.com/SPnl/nl.sp.drupal-civicrm-views-enhancement>
  
  This module adds the name-a-b, label-a-b, name-b-a, label-b-a, contact-type-a, contact-type-b, contact-sub-type-a, contact-sub-type-b, description, is-reserved, is-active to drupal views.
  
  > **Comments:**
  > **username_1**: Sounds great username_2 - what chance of this getting provided back to core as a patch?  
  > **username_2**: I don't have a plan to do that. However feel free to reuse the code for a core patch.  
  > **username_0**: @username_1, this fixed it for me, but I'd be interested in taking my coding skills up a notch and learning how to patch this in so others can benefit.  Where would this code need to go for a patch?  Into Civi Core (where?), the CiviCRM_Entity module, or some other place?  I'm willing to do the work, just need a little direction. :)  
  > **username_2**: The first thing you have to do is to report this as an issue in the issue tracker at https://issues.civicrm.org Then you have to set up a local development environment. I have written a blog on how to do that: http://jaapjansma.nl/2015/08/25/howto-setup-a-civicrm-development-environment-for-fixing-bugs/ after you have done so you could start fixing the bug. This bug should probably be fixed in the civicrm-drupal project on github: https://github.com/civicrm/civicrm-drupal  
  > **username_0**: Thank you @JaapJansma!  This will be a great project for me.  
  > **username_0**: Note for myself -- look at line 2182ff in https://github.com/civicrm/civicrm-drupal/blob/7.x-master/modules/views/components/civicrm.core.inc for originally included fields, format examples and probable place to include fixed code.  
  
  ---
  
  