This documentation refers to an older version of CiviCRM (3.4 / 4.0). View latest version.

Comparaison des versions

Légende

  • Ces lignes ont été ajoutées. Ce mot a été ajouté.
  • Ces lignes ont été supprimées. Ce mot a été supprimé.
  • Formatting was changed.
Commentaire: Migrated to Confluence 4.0

This describes how to add a keyword bookmark (Example is Firefox) to search for a contact in CiviCRM. The need for this came from answering incoming calls from clients - the ability to quickly bring up a list of possible matches helps leverage client details while on the phone.

The resultant url was:

Bloc de code
langhtml
http://www.CIVISITE.COM/index.php?q=civicrm/contact/search/custom&csid=15&reset=1&force=1&text=%s

http://www.CIVISITE.COM: The URL for your CiviCRM install.
%s: This is where Firefox will insert the search terms - 'smith' in the example below. Adjust for other browsers or methods of invoking, e.g. Launchy , Quicksilver  or IE Accelerators.

Thus with this keyword bookmark enabled (I used 'civi' as the keyword) I can type 'civi smith' in the address bar and a page will come up listing all 'smiths' in my database. 

Taking it further.
With a bit of javascript, the keyword url will default to the search page if no search term is given

Bloc de code
langhtml
javascript:if('%s')%20location.href='http://www.CIVISITE.COM/index.php?q=civicrm/contact/search/custom&csid=15&reset=1&force=1&text=%s';
else%20location.href='http://www.CIVISITE.COM/civicrm/contact/search&reset=1';

In the URL above, the first link is the original link from the first example, while the second is the address used if no search terms are given.

I believe this can work for other custom searches as well, you need to adjust the CSID accordingly and (in my unlearned case) add a sprinkling of trial and error.

Notes:

  • You need to be logged in for this to work
  • Don't forget to put your site into the URL, twice in the second version
  • If searching for more than one word, use the following syntax: lastname,firstname
  • This integrates nicely into launchy (use the 'weby' plugin) / quicksilver etc