Field groups

If your content type contains a lot of fields, it may be convenient to break up the data entry in some intuitive way. You can use the field group module to turn a long node creation/editing page into a more succinct tabbed interface. If your content type is for a location, you might have one tab for the name and a description, another for geographic coordinates, another for uploading an image, and another for a multi-value node reference field for similar places. You can do the same for the node display (though you'll have to do it separately, on the "manage display" configuration page)-- perhaps there's some information in the content type that you want to make available for those who are interested, but you feel it would be distracting for non-specialist users of your site. You can use field groups to create a collapsed fieldset to store those fields, and they won't appear unless a user expands the fieldset.

It is also important to understand what the field group module does not do. It does not create a new "thing" in the Drupal database with independent field-like properties. Putting fields inside a field group together doesn't create any real relationship between them. For example, let's say you have two fields-- a user reference field ("contributor") and a text list ("activity", with options like "author", "illustrator", "editor", etc.) You want your content type to potentially have multiple contributors, with each contributor having a corresponding "activity". You may be tempted to try putting "contributor" and "activity" in a field group together, and searching for a way to make that field group have multiple values-- the same way Drupal provides you with an "add another" button when you have an autocomplete field that can store multiple values. This won't work-- it isn't possible to make a multi-valued field group, that configuration option isn't available. There's been efforts among Drupal developers to address this "multigroup" problem for many years; the most widely adopted option for Drupal 7 is a separate module called Field Collection, but it has some quirks and shortcomings. Don't even consider using it with fields that already have data stored in them without backing up your site first in case it deletes data.

The field group module has a lot of configuration options, though they all appear on the "Manage fields" or "Manage display" screen-- there's no separate-screen configuration options like with fields. The "widget" options (which, confusingly, will appear vertically under "field type" once you've saved the field group) determine how field group will set apart its containing fields. Some of the field group options should contain other, nested, field group options, rather than fields themselves. Once you've created a field group, you can drag and drop fields (or other field groups) into the field group, by clicking on the icon that looks like a + to the left of the field name, and dragging from there. The label of a field that's in a field group should appear slightly indented, underneath the name of the field group. If you need to delete a field group where you've already put fields, you don't have to remove those fields first-- Drupal will not delete fields along with the deleted field group.

The field group options are as follows, including the configuration options for each one (accessible by clicking the cog icon, to the left of "delete", which appears once you've chosen a widget for the field group):

  • HTML element - a user-specified HTML element (e.g. div, section). A bare-bones option that makes most sense if you want to control the styling through the CSS of your site's theme; probably not the best choice in most cases
    • You can choose which HTML element, and add attributes and CSS classes that will appear along with it
  • Div - uses the HTML div element to set apart the fields, but unlike the "HTML element" option, it comes with some pre-configured, souped-up display settings that you can control.
    • Fieldgroup settings: collapsible (open by default, if content has been entered in the fields it contains, but can be collapsed), collapsed (closed by default), and open
    • Effect and Speed refer to the animation when the fieldgroup is opened or closed
    • Label element and Show label have to do with whether or not to display the label you entered for the field group above the fields it contains, and how big it should display ("Header 2" will display bigger than "Header 3")
    • ID and Extra CSS classes refer to things that will be embedded in the HTML, which you can leverage when editing the CSS for your site's theme
  • HTML5 - much the same as HTML element option, except it provides a set of HTML5-compatible options
  • Fieldgroup - a good default choice; similar to the Div option, but with simpler configuration options (only settings for whether or not the group is collapsible)
    • Vertical/horizontal tabs group - a recommended option; should be used to contain 2+ "Vertical/horizontal tab" field groups type, to create said tabs. Only one of the tabs in a tabs group should be open; the rest should to be set to "closed", until a user clicks to open it.
    • Accordion group / accordion item - similar to vertical tabs, except without the tab design-- a set of vertically stacked field groups that can toggle open/closed, with a transition animation.
    • Multipage group / multipage - allows you to create a multi-step process for data entry, where the person doing data entry must proceed through the steps in a particular order.
    • "Multipage group" fieldgroups allow you to define the page title (whether to show some variant of "Step 1 of 10"), and whether the "submit" button for the content type and other configuration settings should be on the last page of the multi-page.
    • "Multipage" fieldgroups allow you to put in a description, and define whether that particular field group should be the starting point of the multi-step process. Only one such group should be set as the start. The other multipage fieldgroups and their contents will appear in the order in which they're nested beneath the "Multipage group" fieldgroup.

Word - HTML converter and the online HTML Cleaner are the best free online tools to transform Word, Excel, Google docs, and any other document to web content.

Modules: