3

When I am adding new node by admin/content/node-type/story, there are a lot of settings ordered by groups: Submission form settings, workflow setting, comment settings. But all these fieldsets are all by default collapsed.

My question is: how to make them all default to expanded?

4

I believe you have one of two options...

  1. In Code: Have a look at hook_form_alter() and modify the applicable field groups to be $form['the_form_fieldset']['#collapsed'] = FALSE;
  2. In UI: Modify the CCK types form. Go to your content types, click manage fields on the one you want and then select the 'Manage Form' tab.

Hope that helps!

4
  • Would agree. hook_form_alter seems like the cleanest way to go here
    – wiifm
    Mar 13 '11 at 11:28
  • Thanks for reply. But I have a problem. 1 way - manage fields - I can manage only these fields, which I created. About hook form function. As I read, I should edit core.php and find in this file hook_form_alter section, yes? But there is a problem. Where is this file?
    – user455
    Mar 13 '11 at 11:58
  • @Tom122345: You will not find any hook_form_alter() function, and core.php (or system.api.php) is just a documentation file for the hooks implemented by Drupal core; I don't think you would find that file between the Drupal files. For more information about Drupal hooks, read the documentation.
    – apaderno
    Mar 13 '11 at 12:22
  • @tom122345: Firstly, you never modify core files: you build modules to capture the functionality you want to achieve. Try a google search and try a few module build tutorials. However, I am not sure why you can't see the additional fields when you go to manage the form.
    – lordg
    Mar 13 '11 at 12:45
0

Apart from implementing hook_form_alter() to collapse the form fieldsets present in the node edit form, you can also install and use the Fieldset helper, which is a module that remember the status of the fieldsets, and restore it every time the page containing them is viewed; this means that if you collapse a fieldset, that fieldset will be always shown as collapsed.
As alternative, you can install Override Node Options that, as secondary feature, it also allows selected field sets to be set as collapsed and/or collapsible.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy