CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM (Moderator: Dave Greenberg) »
  • How to add middle name (contact.middle_name) as part of display name?
Pages: [1]

Author Topic: How to add middle name (contact.middle_name) as part of display name?  (Read 941 times)

lee.gooding

  • I post occasionally
  • **
  • Posts: 83
  • Karma: 1
    • Clear River Church
  • CiviCRM version: 4.5
  • CMS version: Drupal 7
  • MySQL version: 5.7
  • PHP version: 5.3
How to add middle name (contact.middle_name) as part of display name?
November 25, 2014, 12:22:22 pm
We have several people in our system with the same first name, but different middle name. I am at a loss on how to get the middle name to display as part of all results and searches. Most importantly, I would like the middle name shown in the autocomplete search, search results, and when viewing a contact.

I have modified the "Display Preferences" but that doesn't seem to change anything. I have the following settings:

Individual Display Name Format
Code: [Select]
{contact.individual_prefix}{ }{contact.first_name}{ }{contact.middle_name}{ }{contact.last_name}{ }{contact.individual_suffix}
Individual Sort Name Format
Code: [Select]
{contact.last_name}{, }{contact.first_name}{ }{contact.middle_name}
I've cleared the cache and there are still no changes...

Please help!

joanne

  • Administrator
  • Ask me questions
  • *****
  • Posts: 852
  • Karma: 83
  • CiviCRM version: 4.4.16
  • CMS version: Drupal 7
Re: How to add middle name (contact.middle_name) as part of display name?
November 25, 2014, 01:00:15 pm
I think you will find that new contacts added to your database will have the new format you have specified for the display name and sort names, but those values are stored in the civicrm_contact table and you will have to specifically update those stored table values for existing contacts.

If you edit a record then the display name and sort name fields should be updated automatically, but they won't change without intervention of some sort.

There is a scheduled job that updates the addressee field, but on my install at least there doesn't appear to be one that updates display and sort name.

How you proceed from here depends on how many contacts you have and what level of coding skills you have.




« Last Edit: November 25, 2014, 01:15:41 pm by joanne »

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: How to add middle name (contact.middle_name) as part of display name?
November 25, 2014, 01:11:00 pm
I believe there is a scheduled job you can enable to update contact display names.
Try asking your question on the new CiviCRM help site.

lee.gooding

  • I post occasionally
  • **
  • Posts: 83
  • Karma: 1
    • Clear River Church
  • CiviCRM version: 4.5
  • CMS version: Drupal 7
  • MySQL version: 5.7
  • PHP version: 5.3
Re: How to add middle name (contact.middle_name) as part of display name?
November 26, 2014, 08:32:12 am
Coleman, is this something that I have to install/setup outside of the user interface? I don't see any "disabled" jobs that seem to relate to updating the display name.

Quote from: Coleman Watts on November 25, 2014, 01:11:00 pm
I believe there is a scheduled job you can enable to update contact display names.

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: How to add middle name (contact.middle_name) as part of display name?
November 26, 2014, 08:46:29 am
Sorry I must have misremembered. I was thinking of the Update Greetings and Addressees job.
Actually you might try that one, as it may have the side-effect of updating display_name.
Try asking your question on the new CiviCRM help site.

lee.gooding

  • I post occasionally
  • **
  • Posts: 83
  • Karma: 1
    • Clear River Church
  • CiviCRM version: 4.5
  • CMS version: Drupal 7
  • MySQL version: 5.7
  • PHP version: 5.3
Re: How to add middle name (contact.middle_name) as part of display name?
November 26, 2014, 10:28:02 am
I'll give it a go. I did notice that new updates to contacts do display the middle name as expected. That will probably be good enough for now!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM (Moderator: Dave Greenberg) »
  • How to add middle name (contact.middle_name) as part of display name?

This forum was archived on 2017-11-26.