I'm trying to add an option to disable the display of nickname in the setting preferences. The checkbox is appearing but it doesn't work, when the option is not checked the nickname field shouldn't appear in the contact. I added the option value with Apiv4.
1 Answer
You might also need to use hook_civicrm_buildForm in an extension to override what's happening in CRM/Contact/Form/Edit/Individual.php, e.g. check the value of your setting something like this but less goofy, and then remove the nick_name field from the form.
-
Is there no way to modify CRM core? Nicknames are more used in the Anglo-saxon world then elsewhere. having a checkbox in display preferences just like 'other firstname' would be great. We could handle this PR but we can't find the functiuns and pages to modify. Commented Mar 3, 2021 at 9:21
-
-
-
do you know which template manages the contact summary where we also want to remove 'Nick Name'. We'll probably go for an extension instead of committing to CiviCRM's core. Commented Mar 17, 2021 at 11:01
-
You shouldn't need edit the template if you use hook_civicrm_buildForm to alter the form based on your setting, but for reference it's github.com/civicrm/civicrm-core/blob/…– DemeritCommented Mar 17, 2021 at 15:24