Answers.Body: <p>For emails you can do this (considering you are using the Nickname field): </p>
  
  <pre><code>{capture assign=nickname}{contact.nick_name}{/capture}
  Dear {if $nickname}{contact.nick_name}{else}{contact.display_name}{/if}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-01-08T21:55:16.313Z
Answers.LastActivityDate: 2018-04-17T04:51:34.403Z
Answers.LastEditDate: 2018-04-17T04:51:34.403Z
Answers.UserDisplayName: Yossi
Answers.Body: <p>You can change the display name for a contact in 2 ways</p>
  <ol>
  <li><p>By using CiviCRM alter display name <a href="https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_contact_get_displayname/" rel="nofollow noreferrer">hook</a> you can change the Display name to a preferred name.</p>
  </li>
  <li><p>Update the format for Sort name and/or Display name by navigating to Administer &gt;&gt; Customize Data and Screens &gt;&gt; Display Preference (civicrm/admin/setting/preferences/display?reset=1) and then update the 'Individual Sort Name Format ' and 'Individual Display Name Format' fields as per your choice.
  (Note: This change will be reflected to contact only if New Individual is added or updated)</p>
  </li>
  </ol>
  <p>HTH</p>
  <p>Pradeep</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-01-08T21:12:43.000Z
Answers.Text: Thanks for the reply, I am more familiar with MySQl than civi and had manually edited some triggers to test the logic I require. I can see that the hooks are a more robust way to achieve the result I want as my triggers would be overwritten during an upgrade.
Answers.UserDisplayName: Simon Moseley
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-01-08T04:40:01.353Z
Answers.LastActivityDate: 2018-01-08T04:40:01.353Z
Answers.LastEditDate: 2020-06-17T09:00:50.810Z
Answers.UserDisplayName: Pradeep Nayak
Answers.Body: <p>Also, there ia a nickname in CiviCRM which you can use for this purpose? There is also a setting that allows you to search on the nickname too.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-01-08T21:08:38.623Z
Answers.Text: Thanks for reply, I have used the nick_name to store the preferred name for this purpose and I will try using Pradeeps's suggestion of a hook to create the preferred display name.
Answers.UserDisplayName: Simon Moseley
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-01-08T08:27:32.987Z
Answers.LastActivityDate: 2018-01-08T08:27:32.987Z
Answers.UserDisplayName: ErikH - CiviCooP
Body: <p>I have used other contact systems in the past and as well as first_name and middle_name there has been a preferred name field. We have several people who have long first names but they go by a shortened name, additionally we have people who are known by a middle name rather than their first name. 
  What I would like is to display the preferred name as the display name. </p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-01-08T03:35:40.823Z
Comments.Text: Where are you looking to display the preferred name as the display name? On the contact profile? Emails? Letters?
Comments.UserDisplayName: Yossi
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-01-08T21:06:11.997Z
Comments.Text: On the contact profile and for emails.
Comments.UserDisplayName: Simon Moseley
Tags: <contacts>
Title: Preferred given name for contact
ThreadText: # Preferred given name for contact
  
  (Asked by: username_0 on 2018-01-08)
  
  I have used other contact systems in the past and as well as first\_name and middle\_name there has been a preferred name field. We have several people who have long first names but they go by a shortened name, additionally we have people who are known by a middle name rather than their first name.
  What I would like is to display the preferred name as the display name.
  
  **Tags:** contacts
  
  > **Comments:**
  > **username_1**: Where are you looking to display the preferred name as the display name? On the contact profile? Emails? Letters?  
  > **username_0**: On the contact profile and for emails.  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_1 on 2018-01-08. Score: 3
  
  For emails you can do this (considering you are using the Nickname field):
  
  ```
  {capture assign=nickname}{contact.nick_name}{/capture}
  Dear {if $nickname}{contact.nick_name}{else}{contact.display_name}{/if}
  
  ```
  
  
  ---
  
  ### Answer by username_2 on 2018-01-08. Score: 2
  
  You can change the display name for a contact in 2 ways
  
  1. By using CiviCRM alter display name [hook](https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_contact_get_displayname/) you can change the Display name to a preferred name.
  2. Update the format for Sort name and/or Display name by navigating to Administer >> Customize Data and Screens >> Display Preference (civicrm/admin/setting/preferences/display?reset=1) and then update the 'Individual Sort Name Format ' and 'Individual Display Name Format' fields as per your choice.
     (Note: This change will be reflected to contact only if New Individual is added or updated)
  
  HTH
  
  username_2
  
  > **Comments:**
  > **username_0**: Thanks for the reply, I am more familiar with MySQl than civi and had manually edited some triggers to test the logic I require. I can see that the hooks are a more robust way to achieve the result I want as my triggers would be overwritten during an upgrade.  
  
  ---
  
  ### Answer by username_3 on 2018-01-08. Score: 1
  
  Also, there ia a nickname in CiviCRM which you can use for this purpose? There is also a setting that allows you to search on the nickname too.
  
  > **Comments:**
  > **username_0**: Thanks for reply, I have used the nick_name to store the preferred name for this purpose and I will try using Pradeeps's suggestion of a hook to create the preferred display name.  
  
  ---
  
  