CiviCRM: Difference between revisions

From Freephile Wiki
No edit summary
(Add section on custom data)
Line 44: Line 44:
== Profiles ==
== Profiles ==
You can create form sets called "Profiles" to be able to easily collect info through the exact forms you need.  CiviCRM Profiles allow you to aggregate groups of fields and include them in your site as input forms, contact display pages, and search and listings features. They provide a powerful set of tools for you to collect information from constituents and selectively share contact information.
You can create form sets called "Profiles" to be able to easily collect info through the exact forms you need.  CiviCRM Profiles allow you to aggregate groups of fields and include them in your site as input forms, contact display pages, and search and listings features. They provide a powerful set of tools for you to collect information from constituents and selectively share contact information.
== Custom Data ==
You can import custom data into 'fields', but first you need to create a fieldset (at <code>civicrm/admin/custom/group?reset=1</code>) to contain even a single custom field.  (Note that fieldsets are referred to as 'custom groups' in the code/system, but should not be confused with contact groups which is another thing altogether.)  Some (most?) data such as health info (weight, cholesterol, height) or volunteer experience (date, location, volunteer activity) or hike (date, trail, notes) should be multi-value since you'll want to record more than a single fieldset per contact. A problem that I ran into was that a multi-value fieldset does not show up in the list of available tokens within the CiviMail component.  These tokens ''are'' still available, but you have to write them into the email message by hand.  On the other hand, if you create a '''single''' value custom data field, those do appear in CiviMail.  So, if you create group "work experience", and fields "Job Title", "Employer", "Date Start", "Date End" etc, AND in the setup of that group, you __do not__ check the box that says "Does this Custom Field Set allow multiple records?", you'll end up with a single value field group and those values will be represented by tokens in CiviMail.  Once created, you cannot change the type of a Field Set from multi to single or single to multi.
In short, there are all kinds of problems with Custom Data.  It's inconsistently represented across Forms, Reports, Contacts, CiviMail.  Plus, even when you spend the time to create a Profile display of the custom data, it's almost useless.  The paging is non-existant; table view with sorting is non-existant.  In Reports (where you can specify custom data fields for output), oddly the '''first''' value is displayed rather than the '''latest'''.
Multi-value Custom Data is such a problem that there is even a wizard for importing it. <code>civicrm/import/custom?reset=1</code>
<blockquote>
Custom tokens (based on custom data) can be added for organizations as well. These tokens will not be displayed in the list of available tokens, but can be added manually. The format is {contact.custom_12} where 12 is the ID of the custom data field. To find the custom data field ID, go Administer > Customize Data & Screens > Custom Fields and click edit on the field you want to use. Look at the URL. The last part of the URL will be an equal sign and a number (=12). The number (12 in this example) is the id of that custom field.
</blockquote>
You can create your own tokens by implementing <code>hook_civicrm_tokens()</code> and  <code>hook_civicrm_tokenValues()</code>.  See
* [https://civicrm.stackexchange.com/questions/2558/tokens-for-custom-field-set-with-multiple-records?rq=1 Stack Exchange]
* https://civicrm.org/blogs/colemanw/create-your-own-tokens-fun-and-profit Coleman's writeup
* http://www.gingerfeet.net/civicrm-userguide-customdatafields <ref>[http://www.gingerfeet.com/home GingerFeet] is a Drupal and CiviCRM consultant + hosting provider like [https://eQuality-Tech.com eQuality Technology]</ref> has an overview that is pulled from the manual, however it may not reflect the most current version - especially since they sell CiviCRM as a service.
* http://book.civicrm.org/user/current/organising-your-data/custom-fields/ the manual itself
* http://book.civicrm.org/user/current/common-workflows/tokens-and-mail-merge/
* http://wiki.civicrm.org/confluence/display/CRMDOC/Tokens
* http://wiki.civicrm.org/confluence/display/CRMDOC/Customized+%28and+Custom%29+Tokens
=== Custom Token extensions ===
Sarah Gladstone of pogstone contributed a couple different Token extensions that you'll find in the extensions system and on github https://github.com/sgladstone/com.pogstone.contenttokens/blob/master/contenttokens.php


== Todo ==
== Todo ==

Revision as of 14:34, 27 July 2015