Fragmented Thought

Drupal - Collapsible Form Item Descriptions

By

Published

Lance Gliser

Heads up! This content is more than six months old. Take some time to verify everything still works as expected.

Original Credit to Drewish, and of course the CCK team for such a fantastic tool. I'm just adding it here for reference, and expanding a bit with the uninstall knowledge.

Install

// Need to load the CCK include file where content_field_instance_create() is defined. module_load_include('inc', 'content', 'includes/content.crud'); // If you wanted to add the field to several node types, loop over them... foreach (array('athlete', 'feature', 'product', 'tech') as $type) { // ...and assign the node type. $field['type_name'] = $type; content_field_instance_create($field); }

Uninstall

content_field_instance_delete($field_name, $content_type);

Note that removing the last instance of a field will remove the field's definition from the database. So you're clean just doing this.