Is it possible to create a node of CCK components and then serialize it in some method for distribution?

I'm working on a module to provide data from CiviCRM. Many of the things I need in my module will be needed by other modules (e.g. selecting a CiviCRM group, user or profile). If I can write these up as CCK fields, others can take better advantage of my work.

I'd also like to create some default uses of these fields - pre compiled CCK content types.

Can I serialize them like I can with a view and implant them in static module code?

Thanks
-M

Comments

kae’s picture

feature request made here
http://drupal.org/node/56286

mfredrickson’s picture

This is not precisely what I'm looking for.

In the views module, an admin can export a view. The exported view is simply the php code to create an object with the qualities of the view. For example, it might have $view->title = 'This is my title'

I would like something similar for CCK. Once I've used the UI to create a node type (composed of the different fields I'm coding, as explained in the 1st post), I would like to export it to a .module file. As an added benefit, I would like to handle the hook_load/_prepare/_view/etc for this node type though I could probably do a lot of what I want through the nodeapi.

-M

robertdouglass’s picture

Libraries for everything:

libraries of exported views; libraries of exported CCK types; libraries of theme functions (when theme functions are their own files); libraries of site configurations.

I believe the CCK team has something like this in mind, but they can definitely use help. Might be worth while opening an issue for this on the CCK project.

- Robert Douglass

-----
My Drupal book: Building Online Communities with Drupal, phpBB and WordPress

mfredrickson’s picture