Core Design Ideas In CiviNode

CiviNode is designed to make the thinnest layer possible over the public CiviCRM APIs, and as much as possible to rely upon CiviCRM as its data store. As an ideal, I'd prefer that little or no data that can be stored in CiviCRM should be stored in parallel in Drupal. This is an ideal, and even at this point, I've needed to break this rule a fair bit, especially to fit into the way Drupal does access control. I am also striving to use only the standard distributions of Drupal and CiviCRM, and to have the modules work with unmodified versions of the most important contributed modules.

The module implements 3 distinct ways of getting to your CiviCRM data in Drupal 4.7 and later:

  • You can use chunks of CiviCRM data as fields in CCK data types.
  • You can display CiviCRM data in Drupal Views.
  • You can create a special node type that "mirrors" a CiviCRM contact as a node.

You can use these techniques in any combination you want. Currently, the most "exercised" parts of the code are the CCK and Views support, since our original funder, the Collective Heritage Institute, is using these features extensively in their new web site.

We'll discuss each of these approaches in turn below.

Comments

i18n - multiple nodes per contact

i was just imagining a module like this over the weekend and am happy to see i'm not alone here. One of the reasons i'm interested in it is to expose contact information on a multilingual site. So i was imagining a system that would generate multiple nodes per contact, one for each language supported, and provide a themeing interface to allow the site implementor to choose which fields would be displayed, and how.

For example: we'd want the address to be displayed differently in different languages, there would be language dependent fields so that a short bio in both english and french would be available.

Does this make sense in your current model?

I was also being somewhat less ambitious in functionality - only exposing data in compiled/formatted/read-only format that would load and display quickly without accessing the civicrm data (and somehow get recompiled whenever the original data was edited).

I wrote it up here: http://groups.drupal.org/node/478