CiviNode/CCK integration
| Project: | CiviNode And Civinode CCK |
| Version: | 5.x-1.x-dev |
| Component: | CCK Integration |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Torenware |
| Status: | closed |
Jump to:
Hi all:
I am working with civicrm(v.1.6) on drupal (v5.1).
I created a content type (using CCK) and created a field with a CiviCRM
Contact Reference and another with a CiviCRM Group reference.
When I try to configure these fields in CCK, I am unable to set the
Teaser or Full display modes to anything but . As a result, I
can fill in these fields using a form, but the contents of these fields
do not show up in teaser or full node displays.
This seems to be some kind of interaction between CCK and CivicNode. I
think I've tracked it down to function
_content_admin_display_overvie
w_row($field, $field_type) in
cck/content_admin.inc, but I haven't delved into the corresponding
CiviCRM code.
Please see this image for detail: http://jackli.us/question.png
For reference, I have enabled modules:
CCK 5.x-1.4
CiviCRM Data 5.x-1.x-dev
CiviNode 5.x-1.x-dev
Thanks in advance for any help you can provide.

#1
This may be a problem with changes to CCK? Here is a partial solution, which at least makes a new formatter show up in the menu. I still need a CiviNode expert to cause the actual content to be output.
Add the following function definition that implements hook_field_formatter_info to civicrm/civinode/contrib/civicrmdata/civicrmdata.module to make the new formatter show up in the menu:
<?php
function civicrmdata_field_formatter_info() {
//get all civi types
$types = array();
foreach (civicrmdata_field_info() as $fields => $val) {
$types[] = $fields;
}
//make the default view for all of them
return array(
'civiformat' => array(
'label' => 'CiviField',
'field types' => $types,
),
);
}
?>
What's needed next is something that implements hook_field_formatter(), displaying some data pulled out of CiviCRM when parameter $formatter is 'civiformat'. Some documentation on hook_field_formatter is at http://drupal.org/node/106716.
#2
Paul,
Much thanks. Can you recommend a module that implements current "best practices" for providing a CCK widget?
I did most of my CCK coding about a year ago, and had to "push the envelope" in a couple of places. It would not surprise me terribly if recent changes in CCK would break some of my code.
As to Cheng Li -- sorry for the delay in getting to this. I will get to this shortly.
Rob
#3
tracking :)
#4
All,
I've started working on this after a long delay. Paul's approach appears to be the right one. I'm going to need to study the current API, since it appears I'm not implementing all of the needed hooks. But once I do that, I should have this up pretty quickly.
Rob
#5
Making myself the owner of the bug.
#6
Paul and All,
I've just posted a new CCK module (civinode_cck) that supports formatters and all. It also has strong support for Views.
More details here:
#7