Drupal: how to set collapsed property for edit-content fields
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.
thanksUpdated: 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开发者_StackOverflow>
</fieldset>
</div>
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.
精彩评论