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) »
  • Tax Id, Marital status. Custom fields in demographic tab
Pages: [1]

Author Topic: Tax Id, Marital status. Custom fields in demographic tab  (Read 1366 times)

JoeTheBronx

  • I’m new here
  • *
  • Posts: 24
  • Karma: 0
  • CiviCRM version: 4.3.3
  • CMS version: Joomla
  • MySQL version: 5.1.65
  • PHP version: 5.3.17
Tax Id, Marital status. Custom fields in demographic tab
June 18, 2013, 11:03:01 am
Is it possible to create a custom field, like in the above example: a tax Id field and/or a marital status field under the "demographic" tab, or generally under an already existing tab?

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Re: Tax Id, Marital status. Custom fields in demographic tab
June 19, 2013, 12:07:25 am
Obviously you can create a custom field in CiviCRM. These custom fields are automatically added to the form inline or in a separate tab. If you want the field to appear somewhere else on the form you can use jQuery to place it somewhere else using a extra.tpl as described here:
http://book.civicrm.org/developer/current/techniques/templates/
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

JoeTheBronx

  • I’m new here
  • *
  • Posts: 24
  • Karma: 0
  • CiviCRM version: 4.3.3
  • CMS version: Joomla
  • MySQL version: 5.1.65
  • PHP version: 5.3.17
Re: Tax Id, Marital status. Custom fields in demographic tab
June 19, 2013, 12:17:07 am
Thanks Erik

So I can't automatically add new fields to an already existing tab in the contacts are of my backend, right? Actually have 3 important informations missing in the backend contact dashboard: place of birth, marital status and TaxId. They could mostly be assigned to the Demographic section, and I was wondering whether they could be easily added.

The link you suggested is in order to set up a frontend template page, right?

Sorry to ask I'm still in the learning process.

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Re: Tax Id, Marital status. Custom fields in demographic tab
June 19, 2013, 12:24:51 am
No problem, been there too :-)
Quote
Sorry to ask I'm still in the learning process.

You can not automatically add fields to existing tabs, that is right. You could add fields to an existing tab programmatically using a civicrm hook. You can find more details on hook in the Developer Guide too.

I send you a link to the template chapter of the Developer Guide. I would not recommend you set up a complete frontend page. If for example you want to add something to the Demographics tab, you first check what template is used. The Developer Guide will tell you how to find that, but it will be CRM/Contact/Form/Edit/Demographics.tpl. You then set up a folder for customized templates and add that to the CiviCRM settings. So CiviCRM knows where your customized templates are.
You then create a new file in your folder using the path, so it will be CRM/Contact/Form/Edit/Demographics.extra.tpl. In that extra template all you do is pick up the custom field using the id or class, and move it to the demographics tab using jQuery? The rest of the template remains intact, as the .extra.tpl is simply added at the end of the core template file.

Does that make sense?
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

JoeTheBronx

  • I’m new here
  • *
  • Posts: 24
  • Karma: 0
  • CiviCRM version: 4.3.3
  • CMS version: Joomla
  • MySQL version: 5.1.65
  • PHP version: 5.3.17
Re: Tax Id, Marital status. Custom fields in demographic tab
June 19, 2013, 05:46:47 am
Ok. I got it... in theory at least...
I've never been into that kind of stuff yet... I'm just  a "do-it-yourself" guy trying to simplify the management of my running club. :)
Anyway you've been clear enough...

So, at the moment, I can simply create a personalized tab which gathers the so far missing fields that I want to integrate to my database. After all, if I understood it right, I could simply create a profile (that could be used on the frontend) so to have all the fields under my order of preferences...

Then, when I'll learn more about jQuery and and the .tpl files I'll do this transfer so that also in the backend the informations will be more homogeneous.

Thanks Erik. I'll save your hint in my notes so to use it once I'm ready to face this new challenge :)

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Re: Tax Id, Marital status. Custom fields in demographic tab
June 19, 2013, 05:48:40 am
Good luck!
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM (Moderator: Dave Greenberg) »
  • Tax Id, Marital status. Custom fields in demographic tab

This forum was archived on 2017-11-26.