Hi all,

I'm trying to get the list of cck fields (and their arrays) for a given content type.
I've already tried calling these functions:
$cck_fields=content_fields($field_name = NULL, 'article');
$cck_field=sarray_keys(content_fields(NULL, $content_type_name)); (where $content_type_name = 'article')
Both calls return all cck fields regardless of the content type.
Any ideas?

Comments

yelvington’s picture

Are you trying to write a node-TYPE.tpl.php file? The Devel module is your friend.

redbread’s picture

Hi!
This is my solution:
See script sites/all/modules/cck/includes/content.admin.inc
string #141-142

$type = content_types($type_name);
$fields = $type['fields'];

You can see an example on your site: admin/content/node-type/[YOUR-NODE-TYPE-NAME]/fields