Upgrade Your Drupal Skills

We trained 1,000+ Drupal Developers over the last decade.

See Advanced Courses NAH, I know Enough

CiviCRM Entity - Working with CiviCRM Contacts on Drupal Node Edit Forms Using Inline Entity Form

Parent Feed: 

It's becoming a common request from our clients to find user-friendly ways to integrate CiviCRM data with the rest of their Drupal website functionality. Oftentimes content creators without direct user access to CiviCRM need to do simple things, such as create, update, and delete contacts in simple, specific ways. 

Example Use Case

A hypothetical organization advertises various community service projects that they organize and coordinate. Each service project can have it's own page, created by adding a Project content type to display a description, images, videos, slideshows or other information for each project. You'll probably use a View to show multiple Project listings on a page. All that is standard Drupal site building content and functionality. No problem.

But what if the organization wants to display to the user the Project Coordinator(s), which they also want to store in CiviCRM as contact(s)? Their Drupal website content creators need to be able to select, create, and update CiviCRM contacts for the coordinator on the Project node edit form in a simple, user friendly way. The website content creators are not given access to the CiviCRM back end. The organization wants the form to be styled like the rest of the Drupal site and be fully responsive.

Challenge

You have CiviCRM data that you need to use with Drupal's standard field and node display and theme structure. What to do?

The Solution

CiviCRM Entity to the rescue!

CiviCRM Entity is a Drupal module which exposes many CiviCRM entities as true Drupal entities. That means that almost any module that can use Drupal entities can also access and manipulate CiviCRM data, Drupal style. This includes many commonly used modules such as Views, Rules, Search APIEntityqueue, and many more.

You can use a standard Drupal Entity Reference field and integrate nearly 30 different CiviCRM entities in the standard Drupal way, into any of your node or entity infrastructures. Contacts, Addresses, Emails, Phone numbers, Events, Contributions, Memberships, Activities, and many more CiviCRM entities can be referenced in a consistent manner.

System Requirements

Drupal 7 and CiviCRM 4.4 or higher 

Install the following Drupal modules and their dependencies:

How To Guide

Read the full set of instructions and screenshots on how to create such an interface for this very real use case on Skvare's blog.

After following the instructions content creators will be able to select, create, update, or delete CiviCRM contacts with ease and assign them as Project Coordinator(s) for the Project nodes! These content creators need not ever see the CiviCRM backend. You can follow the same procedure for CiviCRM Events, and nearly 30 other entities. Cool, yeah?

Have fun with your own specific implementations!

Who are We?

Skvare is a leader in Drupal and CiviCRM integration and project lead for CiviCRM Entity. Contact us to get questions answered and for consultations to make the most of your Drupal and CiviCRM installation.

Original Post: 

About Drupal Sun

Drupal Sun is an Evolving Web project. It allows you to:

  • Do full-text search on all the articles in Drupal Planet (thanks to Apache Solr)
  • Facet based on tags, author, or feed
  • Flip through articles quickly (with j/k or arrow keys) to find what you're interested in
  • View the entire article text inline, or in the context of the site where it was created

See the blog post at Evolving Web

Evolving Web