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

1 Answer 1


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 to override core files, as opposed to editing the actual core files, you also want to take a look at that.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.