views:

330

answers:

2

hi,

can I collapse the field in my edit-content page in Drupal ?

For example, at the bottom of the page Revision Information, URL Path Settings, Authoring Information etc are collapsed.

I would like to have this functionality for the CCK Fields as well.

thanks

+1  A: 

You can do this with hook_form_alter by putting the fields into a fieldset the you make collapsible.

googletorp
A: 

You can also use the CCK Fieldgroup module to create a fieldgroup in the same interface you create new fields. Go to the fieldgroup settings page to make it collapsed by default. Then drag-n-drop fields to be under a given fieldgroup.

Fieldgroup is part of the CCK project, just turn it on in the modules page.

Using hook_form_alter() is a cleaner solution but technically a bit more difficult.

Grayside
So what you suggest, is to use the field group as wrapper, and add the item inside it so I can collapse it.
Patrick
The CCK Fieldgroup is essentially a GUI version of using hook_form_alter(). A fieldgroup is manifested in the Forms API as a fieldset, and the collapsed fieldset properties from the Fieldgroup configuration are pushed into the fieldset definition as well.
Grayside