Field groups have a long history. Since field group was nested in CCK for drupal6, this field group module is only available for drupal 7. As fields moved to core, some submodules of CCK were left out and we had to take on the challenge to make it a contribution.
It is important to know that the purpose of "field group" is to group fields with the intention of wrapping them in a container; not handle logic on the fields. For example, to hide or show a field group depending on some condition you can use Conditional Fields). We chose to have this as display tool by design.
- One of the biggest new features is the unlimited nesting. There are no restrictions to the nesting of field groups and fields in each other.
- API to create custom field group format types or alter existing ones.
Field group types
Field_group has four format types available when displaying the elements on a manage fields page. Refer to "Using the "Field Group" to manage content display for the options when displaying the elements on a display fields page. The following is an illustration of the different options:
- This is available on node details and node forms. You can configure them to be open (normal fieldset), collapsible or collapsed. You can also add classes to the wrapper to use in your CSS files.
- So you always create an accordion group and create a couple of accordion items in the group. Pay attention to the configuration of the defaults. You could in fact set them all to open or closed, however that would not give you the effect you desire.
- Vertical tabs
- This is used from drupal core as well, however some alterations were needed to obtain the vertical tabs on front-end nodes. They work in the same way as accordion in the sense that they also have a wrapper and nested sections. Here we have a vertical tab with tabs in it. You have default values as well to start with one open tab.
Remark Note that you could set tabs without a wrapper. Doing this will make them appear in the node forms default vertical tabs section.
- Horizontal tabs
- Field group provides a library very similar to vertical tabs in core. (In a later stadium I hope some other module or core will provide this.) Place a horizontal tabs wrapper where you can drop your horizontal tab sections containing the fields.
Note: Default configuration requires you to set one tab open just like with vertical tabs.
- YES! You can split your data entry (Create Content / Edit node) forms into multiple pages like a wizard with just the fieldgroup module! Wrap fields in multiple Multipage Items ("multipage" fieldgroup type), and nest these multipage items within Multipage Groups ("multipage group" fieldgroup type). Options on these allow for things like moving the Submit button to the very end of the wizard and changing the 1 of 10 steps labeling.
See attached screenshots for an example:
Multipage fieldgroup config UI
Multipage resultant form