Active
Project:
Content Construction Kit (CCK)
Version:
6.x-2.x-dev
Component:
Documentation
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
17 Apr 2008 at 16:02 UTC
Updated:
14 Apr 2009 at 16:38 UTC
While trying to write a module that uses some of the functions from content.module, I often found it extremely difficult to follow the code because there was little or no commenting and often absolutely no Doxygen-style documentation on the "minor" functions. Please, strongly consider going over all the functions-- no matter how minor they are-- and adding documentation.
Comments
Comment #1
raintonr commented+1 for this. And changing to 6.x as doco on the current version is what would be nice.
Sorry, but I have a 5.x CCK module and am completely lost on how to get my widget upgraded to 6.x. Specifically, the 5.x widget has several inputs inside which seems to make things tricky. Have read the 5-x -> 6.x upgrade page with little success:
http://drupal.org/node/191796
Can someone who knows how to go have a crack at updating some of the CCK documentation pages to be relevant to 6.x, or more likely, create a 6.x version pages like this:
http://drupal.org/node/106716
Would be much appreciated.
Comment #2
ztyx commentedIf it helps, KarenS wrote that the Text and Number modules (in CCK bundle) are throughly documented. You might learn something looking at that piece of code, and maybe even transfer some of that knowledge into comments in the content.module..
Comment #3
raintonr commentedGood suggestion, but...
... have looked at the modules that come with CCK and tried my best to do the same thing.
Somehow though, the widget for my input is not appearing. No errors or anything, just no widget. Through debug message placed in there I know the function specified in the
#processfield returned from the hook_elements is being called. Rather frustrating :(Comment #4
ztyx commentedIt is very funny you mention this. I experienced the exact same thing a minute before I read this. Spooky!
I am learning CCK, too, and I'm trying to upgrade Money CCK field to CCK 6.x. If I fix this I will send you my solution.
Comment #5
ztyx commentedHmm, have you implemented the corresponding theme function that needs to coexist for every element defined in
hooks_elements()?Comment #6
xanoI needed to find out some stuff about CCK hooks, but I was disappointed, because all there was, was a page with limited documentation on the hooks for CCK for Drupal 6.
1) Where has the documentation on CCK for Drupal 5 gone?
2) Why separate the documentation by Drupal version? It had better be separated by CCK version, since CCK 5.x-1.x and 6.x-1.x should have the same features, for instance.
I was looking for a way to manipulate a CCK field through a third module. I found hook_field(), but the documentation does not explain all parameters extensively enough. What do 'alter' and 'sanitize' do, for instance?
Comment #7
autopoietic commentedI found a good tutorial here:
http://www.poplarware.com/cckfieldmodule.html
its for a specific use case - which is why I found it, but it helped me understand the hooks (eg alter and sanitize Xano) and it is clearly labelled where you would depart from the method for other tasks.