Drupal:如何为编辑内容字段设置折叠属性

时间:2010-05-15 15:11:19

标签: php drupal drupal-6 drupal-fapi

是否有任何界面来决定哪些字段应该折叠?哪些字段不在内容页面中?

即。标签已折叠 菜单设置已扩展,创作已扩展..

我希望相反 感谢

更新: 分类超选择字段(如何引用此字段('分类法'不起作用))

<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 个答案:

答案 0 :(得分:1)

Drupal的可折叠字段集的接口是Drupal Forms API #collapsed property。如果此属性设置为TRUE,则字段集将折叠,反之亦然。要更改默认值,不要破解核心文件,而是以Drupal方式(一种)执行,并将其添加到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);
}

之后,您应该clean the theme registry