Book Image

CiviCRM Cookbook

Book Image

CiviCRM Cookbook

Overview of this book

CiviCRM is a web-based, open source, Constituent Relationship Management (CRM) software geared toward meeting the needs of non-profit and other civic-sector organizations.Organizations realize their mission via CiviCRM through contact management, fundraising, event management, member management, mass e-mail marketing, peer-to-peer campaigns, case management, and much more.CiviCRM is localized in over 20 languages including: Chinese (Taiwan, China), Dutch, English (Australia, Canada, U.S., UK), French (France, Canada), German, Italian, Japanese, Russian, and Swedish.CiviCRM Cookbook will enhance your CiviCRM skills. It has recipes to help you use CiviCRM more efficiently, integrate it with CMSs, and also develop CiviCRM.This book begins with recipes that help save time and effort with CiviCRM. This is followed by recipes for organizing data more efficiently and managing profiles.Then you will learn authentication and authorization and managing communication with contacts.Then you will be guided on using the searching feature and preparing reports. We will then talk about integrating Drupal and CiviCRM. You will also be taught to manage events effectively. Finally, learn about CiviCampaign, Civimember, and developing CiviCRM.
Table of Contents (19 chapters)
CiviCRM Cookbook
Credits
Foreword
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Exploring Drupal hooks


You can customize the behavior of CiviCRM by developing a module that takes advantage of the hook system.

CiviCRM is written in a scripting language called PHP, and you use PHP to create all the functions that make CiviCRM work. Some of these functions are exposed to your CMS—in this case, Drupal. For example, there is a function called civicrm_postProcess that runs every time a form is submitted.

You can copy this function and customize it. Each time civicrm_postProcess runs, CiviCRM checks whether there is a customized version of the function, and if there is, it runs that instead. Not all CiviCRM functions are exposed in this way. If they are, they are called hooks.

This recipe shows you how to explore these hooks in Drupal using the civicrm_developer module.

How to do it…

Hooks allow the CMS to extend the functionality of CiviCRM without having to alter any core CiviCRM files. Here, we will add a module that allows us to see which hooks are available to us:

  1. Install...