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 »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • How can I add a custom field to the contact details?
Pages: [1]

Author Topic: How can I add a custom field to the contact details?  (Read 1238 times)

NicolasConte

  • Guest
How can I add a custom field to the contact details?
November 04, 2010, 08:20:13 am
hi

i want to add a text field where i can enter a persons title. how i can i add this to the core contact information between prefix and first name?

thanks
conte

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: How can I add a custom field to the contact details?
November 04, 2010, 11:13:19 am
I assume this is not "Job Title" (which is already present on the contact edit form)...

To inject a custom field as you've described, you'll need to first create the custom data set with that field and get it displaying and updating in it's own custom data panel on the edit form. (That's all done via Administer > Customize > Custom Data). Once that's working, you'll need to customize the smarty templates that render the top section and the custom fields panes in that form so that your "Title" field is skipped in the custom data section, and that field is added to the top section. Relevant templates are:

templates/CRM/Contact/Form/Edit/Individual.tpl

templates/CRM/Contact/Form/Edit/CustomData.tpl

Info on creating customized versions of your site templates at:
http://wiki.civicrm.org/confluence/display/CRMDOC32/Customizing+CiviCRM+Screens and in developer section of "Understanding CiviCRM" book (link above)
Protect your investment in CiviCRM by  becoming a Member!

NicolasConte

  • Guest
Re: How can I add a custom field to the contact details?
November 08, 2010, 12:14:37 am
thanks dave

but the documentation on this is not really useable for "noobs" like me, as the step editing the tpl is described as: Edit the file as needed and save. I also didnt find anything in the link you posted about the two files your mentioned.

Is there another thread about this topic? havent found anything yet.

Any idea what I have to edit to get the custom field into the contact detail section?

thanks
conte
« Last Edit: November 08, 2010, 04:30:32 am by NicolasConte »

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: How can I add a custom field to the contact details?
November 08, 2010, 05:32:06 pm
If you've read the wiki and developer section of the book, you hopefully have some idea about how to get started with this - at least experiment with creating a custom copy of Individual.tpl and starting by experimenting with moving stuff around.  Once you're at that point, if you have specific questions about the "smarty" code in the templates - your best bet might be to jump on the #civicrm IRC channel.
Protect your investment in CiviCRM by  becoming a Member!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • How can I add a custom field to the contact details?

This forum was archived on 2017-11-26.