views:

45

answers:

1

hi, is there any interface to decide which fields should be collapsed and which ones not in content pages ?

i.e. Tags is collapsed Menu Settings is expanded, Authoring is expanded..

I would like the opposite.
thanks

Updated: Taxonomy super-select field (how can I refer to this field ('taxonomy' is not working))

<div class="taxonomy-super-select-checkboxes"><fieldset class=" collapsible collapsed"><legend class="collapse-processed"><a href="#">Tags</a></legend><div class="fieldset-wrapper"><div id="edit-taxonomy-tags-1-wrapper" class="form-item">
 <label for="edit-taxonomy-tags-1">Enter New Tags: </label>
 <input type="text" class="form-text form-autocomplete" value="" size="60" id="edit-taxonomy-tags-1" name="taxonomy[tags][1]" maxlength="1024" autocomplete="OFF">
 <div class="description">A comma-separated list of terms describing this content. Example: funny, bungee jumping, "Company, Inc.".</div>
</div><input type="hidden" disabled="disabled" value="http://localhost/drupal/taxonomy/autocomplete/1" id="edit-taxonomy-tags-1-autocomplete" class="autocomplete autocomplete-processed"><div id="edit-taxonomy-1-20-wrapper" class="form-item">
 <label for="edit-taxonomy-1-20" class="option"><input type="checkbox" class="form-checkbox" value="20" id="edit-taxonomy-1-20" name="taxonomy[1][20]"> Tag1</label>
</div></div>

</fieldset>
</div>
+1  A: 

the interface to Drupal's collapsible fieldsets is the Drupal Forms API #collapsed property. if this property is set to TRUE, the fieldset is collapsed, and vice versa. to change the defaults, don't hack core files, but do it (one of) the Drupal way(s) and add this to your template.php:

function phptemplate_node_form($form) {
  $form['taxonomy']['#collapsed'] = false;
  $form['menu']['#collapsed'] = true;
  $form['author']['#collapsed'] = true;
  // etc. for all fieldsets you want to change
  return drupal_render($form);
}

after this, you should clean the theme registry.

ax
ok cool, it works thanks. Still one question, I'm using taxonomy super-select module, so the taxonomy identifier doesn't work in my form. Where can I get the ids (such as taxonomy, menu.. etc for all modules ?) I've added the html code of the taxonomy super select form field in the question.
Patrick
to get the form ids, you have to check the source code. search for `#collapsed` and see if the array where this property is set is the one you want to change. in the case of Taxonomy Super Select this is a little complicated as there appear to be multiple and dynamic fieldsets. just experiment a little and add some `var_dump()`s here and there. good luck!
ax