Getting CiviCRM Profile Form Fields into new CCK Node Type

redraven - March 10, 2007 - 19:56
Project:CiviNode And Civinode CCK
Version:5.x-1.x-dev
Component:Documentation
Category:support request
Priority:normal
Assigned:Unassigned
Status:active
Description

I'm working on a project using Drupal and CiviCRM.

I discovered CiviNode searching about information on theming CiviCRM contact records.

From the project page description it seems like it should accomplish what is necessary for this project.

I've installed the module, but feeling a little stumped on how to proceed, I'm most interested in exposing a CiviCRM profile to views. Is this possible? The project page alludes to this, but the documentation does not provide a clear path on how best to accomplish this.

I would be very grateful if someone could point me to any further documentation on CiviNode.

#1

redraven - May 17, 2007 - 05:44

Hi,

I have another project that I believe Civinode would be well suited to.

I checked out the the recent commits that were made last month.

I feel there must be something very simple that I am truly missing in regards to getting the CiviCRM data displayed in a view.

What would be the basic steps of creating a simple view to display a predefined CiviCRM profile?

Thanks for all your work on this module, I'm just needing a little more documentation than provided in the README to get myself started using it. I've also spent some time looking at support requests in the issue queue to no avail.

Thanks again

#2

robeano - May 17, 2007 - 18:24

Redraven, I also want to use civinode and I'm at a loss too. I've got it installed, set permissions, I have a CiviCRM profile to use (and set to use in the Civinode configuration: Administer-Site Configuration-CiviNode).

Here is what I've figured out so far. I think you need to create a new CCK type. When you add a field you will see additional CiviCRM options. Then I think you can create a view that exposes your content type. I don't have it working yet, but it's a start.

Either way, I agree some docmentation would be great.

#3

Torenware - May 17, 2007 - 18:59

I'll eventually write a tutorial or an article about how to do this, but I do feel your pain :-)

Here's some quick notes that may help you both.

First, you need to activate the CiviNode CCK module as well, since that's the part that hooks into Views. CiviNode CCK lets you add a contact/profile combination (or even more than one) to any node type you want.

Once you've added a contact or a group to a node type, you can make the field show up in Views as well.

Have either of you tried doing this yet? If so, tell me what was clear to you, and what was harder to figure out.

Thanks,
Rob

#4

robeano - May 18, 2007 - 16:07

I did get it to work. For those of you just giving it a try, you need to make sure you have some solid data in CiviCRM. So sometimes the View looked a little empty, but that was because I had contacts with some missing data.

What is a little confusing is that I was hoping to see the CiviCRM fields available to display in the View but I seem to have only one. I created a CCK node and I specified which profile to use (Name and Address). When creating a View, the Fields section lists the usual fields, and the one that looks like its coming from CiviCRM is called: Profile: First Name. But I only have that one. I did make sure that the profile I used was available for public pages and listings. There are some fields in the Name and Address profile that are available only to User and User Admin, so I would not expect to see them listed with the other available field when creating a view. I will point out that First Name is the first field in the profile. The next field is Last Name and is available for Public User Pages and Listings.

Another weird thing is that I think it is showing the Volunteer Profile in the View not that the Name and Address profile as I specified. On one of my earlier attempts, I did specify the Volunteer profile for the CCK node. I tried clearing the Views cache, but it doesn't seem to have an affect. When I vew the couple of nodes I have created in the view it shows "Volunteer" as a fieldset with what I think are the fields for the Volunteer profile. Maybe I should start with a new CCK type and try again? I may have messed things up one too many times.

#5

gracearoha - May 28, 2007 - 10:46

Rob,

you said,
"First, you need to activate the CiviNode CCK module as well, since that's the part that hooks into Views."

Is this the module called, "CiviCRM CCK Widgets"?
I have civinode 5x-1x installed and what i see on my admin/build/modules page under CiviCRM are:
civicrm_countblock
CiviCRM Data
CiviNode
CiviCRM CCK Widgets

Also, has anyone tested this on CiviCRM 1.7 yet?

Thanks alot for all the hard work.

cheers,
grace

#6

mgifford - May 29, 2007 - 19:21
Title:CiviNode Documentation» Getting CiviCRM Profile Form Fields into new CCK Node Type

Ok, I'm using CiviCRM 1.7.9379 and so perhaps this is a problem with a change in the CiviCRM API, but I can't seem to get the fields that I've defined in a CiviCRM profile to show up (or be selectable) within CCK (or views for that matter - but I'm less worried about that). I've downloaded recent versions of CiviNode & CCK (civinode-5.x-1.x-dev.tar.gz & cck-5.x-1.5.tar.gz).

Of all of the CiviCRM content fields available, what should I be looking for. So far the options that seem most possible are:
CiviCRM Contact
Contact Autocompletor
Contact Selector (10 or less contacts)
CiviCRM Profile Reference
Select List
CiviCRM Contact Reference
Select List
Autocomplete Contact Search

However since I ultimately don't want the user to have access to the fields I've defined in the CiviCRM profile I'm a bit confused here. Are these just things that need to be defined manually in the node-content_NAMEOFTYPE.tpl.php file? I've browsed a great many CCK pages looking for information about this now. Any thoughts would be appreciated.

Mike

#7

gracearoha - June 7, 2007 - 04:27

Mike,

I also have the same questions.
Can anyone out there explain a bit more clearly how civinode CCK and views work together?

Thanks!

#8

Torenware - June 21, 2007 - 07:31

I'll do more detailed docs on views support soon, but here's the basic principles:

  1. Create a content type that contains a CiviCRM contact item. It doesn't matter how you set the display options in CCK, since Views has its own settings.
  2. Now when you go into Admin / Build / Views and create a new view, look at the list of possible field types. Your new CCK fields will appear in the popup in the Fields section.
  3. Add your contact-based field to your field list using the Contact Field or Contact Field Link display options. The "option" field that appears can have the name of any CiviCRM contact field (e.g., "display_name", "sort_name", or any other field name used in your contact.).
  4. If you want to display multiple fields for the same contact, just add the same field again with a different value in the "option" slot.

There's more help strings in the UI now, and you should be able to get a sense of how it works by playing around a bit with the interface.

#9

yurtboy - August 20, 2007 - 09:57

Same problems here as the above.
May be a civi 1.7 to 1.8 and drupal 5 glitche.
Using the civinode 5.1
All I get in the views or content type for fields is CiviField and no other options?

#10

yurtboy - August 21, 2007 - 22:50

So here are my 2cents on getting this to work.
When choosing a CCK field do not choose the CiviNode XXX "Reference" ones but the ones without the Reference near their name.
The Reference one is for module reference I believe

#11

joemaine - August 23, 2007 - 17:29

I think I've tried everything and still can't get a view to work. I've followed each of the steps...multiple times and am at a total loss.
Drupal 5.0 / CiviCRM 1.7.9379
CiviNode 5.x-1.1
CiviCRM CCK Widgets 5.x-1.1
all installed, enabled and configured
group and profile established (minimal content as test)
The fields I want to use are visible in the 'content type' (default), but the view just can't seem to pick up the data. Persistence usually works...but it's beginning to seem futile. Are there other modules or patches that I'm missing? Is innodb needed for this to work? Are there any special settings in group or profile that would cause a problem? Do custom data fields create any issues? Are there any special fields that need to be included in either the custom data or views (ie. special database ID or references?) Would an upgrade to CiviCRM 1.8 help or just make things worse? (I was hoping to wait until 2.0 for an upgrade)

 
 

Drupal is a registered trademark of Dries Buytaert.