Add nickname field to Individual Contact Type

Created on 21 May 2025, 23 days ago

Problem/Motivation

Nickname is a common field to describe an individual. It avoids the urge to change a Contact's First Name to represent their preferred name or nickname, losing their first name in the process. This field is present in CiviCRM.

Proposed resolution

  • Add a Nickname text field to the Individual Contact Type
  • Possibly adjust the logic that sets the Contact's "name" base field

Remaining tasks

User interface changes

API changes

Data model changes

πŸ“Œ Task
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States jdleonard Austin, TX, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @jdleonard
  • πŸ‡ΊπŸ‡ΈUnited States jdleonard Austin, TX, USA

    Interestingly, CiviCRM has "nickname" on Individual, Household, and Organization. I'm not sure I understand the use cases for Household or Organization having a nickname.

  • πŸ‡ΊπŸ‡ΈUnited States tyler.ashbaugh.questionmark

    @jdleonard, I'm going to create an issue fork for this issue.

  • πŸ‡ΊπŸ‡ΈUnited States bluegeek9

    If the intention is to have nickname be a part of the individual's base name, it might be better to have nick name as part of the name field. ✨ Add more 'parts/fields' to the name Active

    Maybe alias is better. Maybe aliases.

  • πŸ‡ΊπŸ‡ΈUnited States jdleonard Austin, TX, USA

    Thanks for jumping in Tyler! This seemed relatively simple until it didn't, haha!

    Steve, I'm late to the game on the Name Field module. Thanks for your recent contributions there!

    My perception is that the Name field has purposefully avoided hosting the text of a preferred/nickname, but I don't understand why. Maybe a philosophy that a nickname is "not a name"? It feels like it might be an uphill battle to get Name to host a nickname.

    However the module appears to provide a passthrough of sorts...

    After adding a nickname field to the Individual bundle, it looks like one can then reference it via the field config form ("Preferred component source") at /admin/structure/crm/contact-types/manage/individual/fields/crm_contact.individual.full_name. Then it becomes available via the name formatters / field formatter.

    Do I have that right? It sure feels awkward, but also workable.

    What's your recommendation for how we proceed?

  • πŸ‡ΊπŸ‡ΈUnited States bluegeek9

    Do I have that right? It sure feels awkward, but also workable.

    I think that should work.

    Maybe a better way of asking my question is how do you want the individual's name appear if a Nickname is entered? Not the strange format of letters used by the name formatter service.

  • πŸ‡ΊπŸ‡ΈUnited States jdleonard Austin, TX, USA

    Unfortunately that will undoubtedly depend on the organization using CRM.

    In one system I use, I track people as:
    LAST, FIRST [MIDDLE] [NICKNAME]

    For me, that's:
    Leonard, John Daniel Hayes "JD"

    Eventually I think it would be nice for there to be a configurable default for the site and an option for a User to override this.

  • πŸ‡ΊπŸ‡ΈUnited States bluegeek9

    The individual's full name field has settings for a preferred name and an alternative name.

    admin/structure/crm/contact-types/manage/individual/fields/crm_contact.individual.full_name

    The name module provides name formats, but none use the preferred name. We will need to add a custom Name format or update an existing format to use the nickname.

    In another issue, do we want to add a field for maiden name (alternative name)?

  • πŸ‡ΊπŸ‡ΈUnited States jdleonard Austin, TX, USA

    I think the top priority should be providing a field so that nickname / preferred name can be stored. And might as well connect it to the Full Name field via the field reference there.

    I'm less bothered about whether it is included in a Contact's label / in a name format OOTB though I think it would be sensible to provide some options for name formats. Perhaps name format options should be a follow-up issue that incorporates i18n considerations, which makes things more complicated, but is important to maintain a global scope.

    Maiden name is interesting. While nickname / preferred name seems very generally applicable, I suspect that the value of tracking a maiden name varies significantly by end user and surely is irrelevant for some countries/cultures. My gut says no to maiden name as an OOTB offering, at least unless and until we've tackled more generally valuable needs. FWIW Civi does not ship with a maiden name or alternative name field.

  • πŸ‡ΊπŸ‡ΈUnited States bluegeek9

    If we are adding a field, I think we should do something with it.

    Below is the default formatter. The 'g' is for given name. I think we should provide a format with g replaced with p.

    ((((t+ig)+im)+if)+is)+jc

    These are the available 'tokens' for the preferred name.

    This could be done in a follow up issue.

  • πŸ‡ΊπŸ‡ΈUnited States bluegeek9

    bluegeek9 β†’ changed the visibility of the branch 1.0.x to hidden.

  • πŸ‡ΊπŸ‡ΈUnited States jdleonard Austin, TX, USA

    Okay, I've updated the IS to reflect next steps here, restricted to adding a preferred name / nickname field and referencing it from the full_name field. I also added locking these fields (inspired by other issues about locking) as they are foundational.

    I'll create a stub issue to follow up about name formats etc.

    @tyler-ashbaugh, I think this is ready for you if you're still game!

  • πŸ‡ΊπŸ‡ΈUnited States jdleonard Austin, TX, USA

    Created follow-up ✨ Customize display of contacts' names Active

  • πŸ‡ΊπŸ‡ΈUnited States jdleonard Austin, TX, USA

    Note that the full_name field is now locked, so you'll need to temporarily unlock it to make the "Preferred component source" change via the UI.

  • πŸ‡ΊπŸ‡ΈUnited States bluegeek9

    In one system I use, I track people as:
    LAST, FIRST [MIDDLE] [NICKNAME]

    For me, that's:
    Leonard, John Daniel Hayes "JD"

    Is Daniel part of your middle name or given name? I think the name field has this covered

    I    Initials (all) from given and family. (uppercase I)
    J    Initials (all) from given, middle and family. (uppercase J)
    K    Initials (all) from given. (uppercase K)
    M    Initials (all) from given and middle. (uppercase M)
    y    First letter middle. (lowercase Y)

    LAST, FIRST [MIDDLE] [NICKNAME]

    Leonard, John Daniel Hayes "Clamps"

    It is worth mentioning the preferred name field can also be used as aliases (AKA). If the field has multiple values it is rendered with a seperator (default: comma) in the name field. I don't think we want to use this as aliases (AKA). If we want aliases that should be a different field.

    The preferred name can be configured on the field, but also per display. We should use the field machine name `nick_name`

  • πŸ‡ΊπŸ‡ΈUnited States bluegeek9
  • πŸ‡ΊπŸ‡ΈUnited States bluegeek9

    After thinking about it some more, I think preferred name is just what someone prefers to be called, were the alternative name would be better for nicknames like "Clamps".

  • πŸ‡ΊπŸ‡ΈUnited States bluegeek9
  • πŸ‡ΊπŸ‡ΈUnited States jdleonard Austin, TX, USA

    "John Daniel" is my first name.

    As someone who goes by a name ("JD") other than his legal name, I am used to setting my "preferred name" to "JD" when the capability exists. Are you proposing that my Contact record would have "JD" in both "Preferred Name" and "Alternative Name"?

    Lightly researching, it is becoming clear to me that there are diversity, equity, and inclusion considerations for the naming of name fields and how they are presented. We should run a more final plan by #diversity-inclusion in Drupal Slack for feedback.

  • πŸ‡ΊπŸ‡ΈUnited States bluegeek9

    Your Preferred name is JD
    Your Alternative name is "Clamps".

    I had to give you a nickname/mafia name.

    https://www.ign.com/wikis/futurama/Clamps

  • πŸ‡ΊπŸ‡ΈUnited States bluegeek9
  • πŸ‡ΊπŸ‡ΈUnited States bluegeek9
Production build 0.71.5 2024