Linking Profiles
PROFILES may be linked to specific modules, used to create standalone forms as well as search and listing pages.
Examples of module links include:
- User - One or several profiles can be linked to either the new user registration and/or view and edit screens for existing user accounts.
- CiviContribute - When you want to collect information from Contributors via online contribution pages, you can create a profile and link it to your contribution page.
- Profile Listings - When you want to provide a search form and search result listings for some or all of your contacts you can create a profile with the desired search fields and link users to the path for that search form. You can also limit the search results to a specific group of contacts. For example, maybe you only want Organization Staff to be searchable. You would limit this profile to only contacts in your "Staff" group.
 | Search and Listings Pages When creating a link to search and listings profiles, add the corresponding profile ID to the end of your query string using the 'gid' parameter. For example, the link to display a search and listings page for a Profile with ID = 3 would be: /civicrm/profile?reset=1&gid=3 |
 | Using Profiles in Joomla! Sites Currently, Profiles can not be linked to new user registration and user account editing in Joomla! sites. We hope to correct this limitation after the release of Joomla 1.5. Keep this limitation in mind when reviewing the following section. However, you can include Profile forms, search and listings pages in your front-end Joomla! site by following these instructions |
- Search Results - If you want to customize the columns which are displayed in Advanced Search results. For example, you might have a critical custom field that you want included in the results listings.
Permissions for Profiles (Drupal Only)
For Drupal installations, you can use Drupal Access Control to determine which "roles" can access Profile forms and listings (as well as Contribution and Event Registration pages with contain Profiles):
- If you want anonymous visitors (i.e. folks who are not logged in to yoru site) to have access to profile pages, you need to grant the profile listings and forms permission to the Anonymous role.
- If you are using custom fields in your profiles and want anonymous visitors to access the form or page, you also need to grant access all custom data permission to the Anonymous role.
Since many sites use profiles for constituents who may not have user accounts - this configuration is the most common. However, you can restrict general access to profile pages and forms by assigning these permissions to specific roles.
If you need to limit access to specific profiles for subsets of your user population - you can do so using by using Access Control Lists (ACLs) (learn more...).
Standalone Contact Creation or Sign-up Forms
If you want to place standalone contact sign-up form(s) anywhere on a web-site (outside of CiviCRM pages) from the listing of Profiles, click the Standalone Form link.
- You can edit the provided HTML to eliminate fields for this use (as long as they aren't marked required in the Profile field setup).
- You control the post-form-processing landing page by modifying the postURL hidden field value (replace the default URL with any other valid URL).
 | Using Standalone Profile forms in Joomla! To use a Standalone Profile form in Joomla!:
- First create your Profile.
- Then create a menu link to the profile as a "create profile" type, and make sure the link is published and public. Test the Profile link as a built-in form.
- In the Standalone HTML generated by CiviCRM, replace the generated form action URL with a copy of the URL from the menu link.
|
Linking to Built-in Contact Create/Sign-up Form(s)
 | Refer to your Drupal or Joomla documentation for information on creating links and menu items. |
- Make sure your profile has and includes at least first name and last name OR email address, as these are the minimum required fields for creating a new contact.
- You must also check the option "Used for: Profile" in the Profile settings.
 | Contact Sign-Up Forms If you simply want to present a contact sign-up (create) form independent of the Drupal 'create account' process, link to <site root>/civicrm/profile/create?reset=1&gid=N where N is the ID of the Profile. (Each Profile has a unique numeric ID - you can find the value by checking the second column of the table at CiviCRM » Administer » CiviCRM Profile) |
Linking to Built-in Contact View and Edit Page(s)
 | Refer to your Drupal or Joomla documentation for information on creating links and menu items. |
You can also use a Profile to give logged-in users a way to view and/or edit specific fields from their own contact data.
As with any profile, you control the fields you want exposed to these view and "self-service edit forms" by the fields you select to include in the profile.
 | Custom Edit Form Give your logged in users a custom edit form by linking to <site root>/civicrm/profile/edit?reset=1&gid=N where N is the ID of the Profile. (Each Profile has a unique numeric ID - you can find the value by checking the second column of the table at CiviCRM » Administer » CiviCRM Profile).
Any information that exists in the contact record for the included profile fields will be retrieved and displayed in the form. |
 | Custom Contact View Give your logged in users a customized view of their contact info by linking to <site root>/civicrm/profile/view?reset=1&gid=N where N is the ID of the Profile. Any information that exists in the contact record for the included profile fields will be retrieved and displayed. |
 | Allow Anonymous (not-logged-in) Users to Edit Their Profile
A great feature is to "invite" your non-logged in users the ability to view and edit their contact info via a profile using CiviMail. To do this, insert the following link with appropriate tokens as shown into a CiviMail message:
http://<site root>/civicrm/profile/edit?reset=1&gid=N&id={contact.contact_id}&{contact.checksum}
... where N is the ID of the Profile you want them to use for editing. The contact checksum token generates a special link that gives a user access to the profile for 7 days from the day you send them the mailing.
NOTE: There was a bug where the above path would not work in text format because CiviMail did not convert both tokens (ID & checksum) in a single path. This has been fixed in 2.1 and there are patches available within this forum posting http://forum.civicrm.org/index.php/topic,3905.0.html More information can be found on the issue tracker here: http://issues.civicrm.org/jira/browse/CRM-3301 |
Profile Search and Listing
To allow searching and listing of profiles:
Link to <site root>/civicrm/profile?reset=1&gid=N (where N is the Profile ID) to display a Search and Listings page which provides basic search on any "Public and User Listings" Profile fields - and returns a sortable listing of contacts.
For example: the link to display a search and listings page for a Profile with ID = 3 would be <site root>/civicrm/profile?reset=1&gid=3
 | Listings With and Without Search Forms If you are using profiles to list members of a group - you can have the group members appear automatically when the profile page is loaded by using the force parameter. You can also hide the Search form by adding &search=0.
To immediately a listing for Profile ID 3 without a search form:
|
You can also create external links to specific Listings filters by creating the url q=civicrm/profile?reset=1&force=1&gid=N&field_name=value.
- Example:civicrm/profile&reset=1&force=1&gid=N&city=London
- The above url actually does a search, so you can link together sequentially multiple fields. Thus to see all "Democrats" in "California" in my local site, I can use this URL:
civicrm/profile&reset=1&force=1&gid=N&custom_2=Democrat&state_province-Primary=1228
Be sure to verify the correct field names and values to use in these these URLs by checking the field link from a My Account page, OR by browsing to your profile's listing page without additional filters and doing View Source from your browser.
Showing a map is also possible:
- Create the profile. Limit listings to a group if needed. Let's assume profile id is PID.
- Make sure you have mapping enabled for this profile
- The url to map all contacts from that profile is: q=civicrm/profile?reset=1&gid=PID&force=1&map=1
 | Each Profile has, under Settings (Advanced Settings section) the option to Limit Listings to Group. If you are reading this looking to figure out how to format a complex query string, like I was trying to do, Senators & Delegates or something, or not null in some field, do yourself a favor and create a Group, then use Limit Listings to Group to control which contacts are available in the profile search. |
Customized Advanced Search Results
To display a different set of columns from the defaults in Advanced Search results:
- Create a Profile, and check Search Results in the Used For field.
- Add ALL the fields you want included in the results to this profile. For each profile field, check the In Selector.
- Go to Advanced Seach and select your profile in the Search Views dropdown (upper right)
- Do a search - the results should display the columns (fields) from your profile.