Does anyone know where i can read about CCK API, i am interesting how to create fields for content type programaticly by using powerfull module CCK.
Thanks.

Comments

WorldFallz’s picture

There's developer docs available via the 'read documentation' link on the module's project page.

ibragim’s picture

I am realy surprised that in this powerfull module(CCK) no API to create node type or field, it's must be SHAME for developers!!!

WorldFallz’s picture

I have no idea what you're talking about-- there's a complete api, including hooks, available. And creating a node type was moved to core with d5, see http://api.drupal.org/api/function/hook_node_info/6

ibragim’s picture

thx for this information!
i just want to say that it would be great to have ability create node types and (important!) field just calling some functions,
as example:
hook_node_info() // here we define node type
create_field ("node_type") // here we create new field, like it's do CCK, but put all needed information here, incoming node type name

WorldFallz’s picture

THERE IS

ibragim’s picture

Ok, can you provide some little example? (Like, How to create new field for node type that already exist)

jaypan’s picture

Are you even reading Worldfallz posts? The guy told you exactly what you asked, and your next posts were completely ignoring him. As for the answer to your last question, a simple search on the site would give you the answer faster than we can type it for you.

Contact me to contract me for D7 -> D10/11 migrations.

ibragim’s picture

I can't find example to Drupal 5.x, if to you not hard to write little example, please do this.

WorldFallz’s picture

ok i'm done-- if you continue to refuse to read anything you'll not find much help in the forums. The first link in the api page i linked above is a "a sample cck field' and it's tagged with d5, sheesh. no one is going to rewrite the available handbook documentation in a forum thread just for you.

ibragim’s picture

Thanks everyone, I would like to receive an adequate answer to the question, but it turned out as always.
Awesome support.

jaypan’s picture

How rude. You asked questions, you were given answers, then you complained about the lack of help.

I'll tell you what, you should ask for a refund. You obviously paid too much money for the assistance you got here.

Contact me to contract me for D7 -> D10/11 migrations.

WorldFallz’s picture

no one is going to rewrite the available handbook documentation in a forum thread just for you.

lajthabalazs’s picture

I had the same question, and Google directed me to this forum. Interesting conversation :) Thanks a lot for the answers provided in your second post, the linked pages appear useful.

botanik’s picture

I think this function help you http://drupalcontrib.org/api/function/content_field_instance_create/6

For example:
// Create several fields at a time.
foreach ($fields as $field) {
content_field_instance_create($field, FALSE);
}
// Clear caches and rebuild menu.
content_clear_type_cache(TRUE);
menu_rebuild();