I have a custom field of an individual that stores the ID of a group (as int). I would like to change the display of the field to show the actual name of the group instead of the ID (same as contact reference functionality).
At the very least I would like to have this done on the contact summary page.
I have tried hook_civicrm_alterContent, but I am unsure how to change the actual displayed field value.
NOTE: I am able to get it to work by adding some javascript to the hook using jQuery to alter the value. This seems very hacked and getting the proper field is difficult because Civi does not sent distinct ids or classes for the fields being displayed. Something as simple as changing the display order of the fields would break it.