Using URLs to change profile displays
In the previous recipe we used a URL to access the profile we created, that is, civicrm/profile/create?gid=N&reset=1
, where N
was the ID of our profile. This URL made the profile appear as a form where we could create a contact.
How to do it…
By using different URLs you can create search forms and listings:
- Create a search form with this URL:
civicrm/profile?gid=N&reset=1
.This provides a search form. When you create your profile, you must make sure that field visibility is set to Public Pages or Public Pages and Listings.
- Create a listing with an editable search with this URL:
civicrm/profile?gid=N&reset=1&force=1
.This provides a listing with editable search criteria at the top. When creating the profile for this, under the Advanced settings, you can restrict the contacts listed using Limit listings to a specific Group.
- Create a listing without a search with this URL:
civicrm/profile?gid=17&reset=1&force=1&search=0
.This...