Drupal: CCK API Docs

Any good CCK API out there? I've seen http://api.audean.com/ but can't find what I want there.

Basically, I need a function that takes the name of a field and returns what the type of node is of that field. I wrote my own but would rather make an API call.

+2


a source to share


1 answer


CCK is awesome module, but has terrible outdated documentation. :(

As you browse through the module files, you will find content_fields ($ field_name) that can provide the functionality you are looking for.

The function takes a field name and returns an array of all parameters for that field. The node type is stored in ['type_name'], so you can write something like the following:



$field = content_fields('field_myfield');
$node_type = $field['type_name'];

      

This should give you the node type for the field_myfield.

+1


a source







All Articles