Hello,
I am working to expose CiviCRM data as reference fields in CCK (just like the node reference and user reference modules). For example, I have CiviCRM contact reference fields, profile reference fields, etc.
CCK seems to assume that every field type is a sufficient amount of data to render on view. However, most CiviCRM 'functions' are multi-variate. For example, to edit a user one needs both the contact record AND a profile record (the profile holds a mapping of fields to update).
Is there a way to combine multiple fields into a single widget? It seems strange that I would need to define an additional field, when the components have already been defined.
I suspect this will require a change to the contact.module code. Looking at the contact_view function, I see:
function content_view(&$node, $teaser = FALSE, $page = FALSE) {
$node->body = implode('', _content_field_invoke('view', $node, FALSE, $page));
$node->teaser = implode('', _content_field_invoke('view', $node, TRUE, $page));
$node->readmore = ($node->body != $node->teaser);
}
It seems strange to me that fields are responsible for rendering themselves. Perhaps we need some sort of output widget? Or at least of method of grouping relevant fields into super-widgets that can be rendered differently than the component parts.
Thanks for the excellent work on this module.
-Mark
Comments
Comment #1
JonBob CreditAttribution: JonBob commentedI think this goes with http://drupal.org/node/57483