Answers.Body: <p>If you look in CRM/Core/xml/Menu/Contact.xml you'll see that the civicrm/ajax/contactrelationships maps to CRM_Contact_Page_AJAX::getContactRelationships, so you can go into CRM/Contact/Page/AJAX.php and change what the getContactRelationships function does.</p>
  
  <p>If you're not familiar with the techniques <a href="https://wiki.civicrm.org/confluence/display/CRMDOC/Customize+Built-in+Screens" rel="nofollow">here</a> to override core files, as opposed to editing the actual core files, you also want to take a look at that.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-05-11T23:40:15.410Z
Answers.LastActivityDate: 2016-05-11T23:40:15.410Z
Answers.UserDisplayName: Demerit
Body: <p>I want to customize the information provided by templates that are generated via the dataTable plugin. Specifically, I want to alter the RelationshipSelector.tpl to display a contact's title and a couple of custom fields.</p>
  
  <p>The dataTable script in the RelationshipSelector table makes a call to civicrm/ajax/contactrelationships via AJAX. It returns JSON. I noticed that the dataTable plugin elsewhere makes calls to civicrm/ajax/*.</p>
  
  <p>Is there a way I can alter the JSON that is returned to include my fields?</p>
  
  <p>I'm running a Drupal + Civi 4.6</p>
  
Tags: <relationships><ajax>
Title: How can I change the fields displayed by dataTables?
ThreadText: # How can I change the fields displayed by dataTables?
  
  (Asked by: username_0 on 2016-05-10)
  
  I want to customize the information provided by templates that are generated via the dataTable plugin. Specifically, I want to alter the RelationshipSelector.tpl to display a contact's title and a couple of custom fields.
  
  The dataTable script in the RelationshipSelector table makes a call to civicrm/ajax/contactrelationships via AJAX. It returns JSON. I noticed that the dataTable plugin elsewhere makes calls to civicrm/ajax/\*.
  
  Is there a way I can alter the JSON that is returned to include my fields?
  
  I'm running a Drupal + Civi 4.6
  
  **Tags:** relationships, ajax
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2016-05-11. Score: 0 | Accepted answer
  
  If you look in CRM/Core/xml/Menu/Contact.xml you'll see that the civicrm/ajax/contactrelationships maps to CRM\_Contact\_Page\_AJAX::getContactRelationships, so you can go into CRM/Contact/Page/AJAX.php and change what the getContactRelationships function does.
  
  If you're not familiar with the techniques [here](https://wiki.civicrm.org/confluence/display/CRMDOC/Customize+Built-in+Screens) to override core files, as opposed to editing the actual core files, you also want to take a look at that.
  
  
  ---
  
  