cck

Creating multigroup widgets in Drupal 7 (3)

When the multigroup module was introduced as part of the CCK 3.x dev branch in 2009, it took CCK to a whole new level. It allowed people to easily create their own multi-value, multi-field widgets. Currently it is still only available as an alpha release for Drupal 6 though, most likely to focus more on Fields for Drupal 7 and to allow an easier upgrade path from Drupal 6 CCK 2 to Drupal 7 Fields. More information about this decision can be found on the drupal.org issue about the Status of CCK3 and plans for D7

In Drupal 7, the core Fields module doesn't offer the option to create groups, let alone multigroups. To create simple groups, you need the Field group module. It's much more powerful than its predecessor in that it allows you to not only create fieldsets, but also vertical and horizontal tabs and accordion groups.

Field group configuration

The Field group module does not cover any multigroup functionality however, and it never will. It states so on the module's project page, and more information can be found in the issue queue.

Luckily there's the Field collection module which uses the Entity API to create multi-value, multi-field widgets. The Field collection table module adds a table formatter to the collections, and Field collection also integrates with Field group to offer amazing flexibility and power. As an added bonus, both modules integrate flawlessly with Features. At this time, there is no upgrade path from D6 Multigroup to D7 Fields with Field collection though.

Continue reading »

The Wysiwyg and CCK multiple value fields (10)

Setting up a Wysiwyg or rich text editor in Drupal is a straightforward task: you download the Wysiwyg module along with the library of your favorite editor and you're good to go. You will run into issues when you're using CCK multiple value fields though:

  • You will experience data loss when adding more fields: all content added to existing fields will disappearing when you click the "Add another item" button to add a new field.
  • Depending on which editor you use, there's a chance of hick-ups and data loss when using the drag-and-drop interface to rearrange fields.
  • Depending on which editor you use, you will run into different kinds of unexpected behaviors when adding your first new item after clicking the "Add another item" button. These issues can range from the editor only appearing on the first field, to only appearing on the last field, or from the editor disappearing completely.

The first two issues can be fixed by installing the Wysiwyg API CCK Integration module, which itself depends on three other modules: JS Alter, jQuery Form Update and jQuery AOP. These modules require no configuration: just enable them to fix the problems.

The third issue however is more tedious. I've tried fixing the bug with hook_form_alter() and CCK fields along with the Wysiwyg integration guide but these don't play along nicely. The added difficulty is that the problem varies depending on which editor you use. The only bulletproof "solution" I've found this far is to simply use the FCKeditor editor: it's the only editor that doesn't appear to cause any unexpected behavior. Do note that these problems are only fixed if you use the FCKeditor with the Wysiwyg module: the FCKeditor module itself still has these issues.

Continue reading »

CCK 3: Introducing the multigroup module (27)

Yesterday we saw the birth of the CCK 3.x dev branch. One of the many exciting new features is the addition of the multigroup module. A multigroup works exactly like a regular fieldgroup in that it allows you to group different widgets together. You can for instance create a custom address group with textfields for the street name, zipcode and city, or a profile group with a nickname textfield and an avatar image upload field. What's new is that you can create a multi-value widget from these groups. So you can now create your own image gallery widget by setting up an image upload field, a title textfield and a description textarea and combining them in a multigroup.

This is another powerful step in eliminating the middleman by allowing administrators and editors full control, not only over the content types, but the widgets as well.

Continue reading »
Syndicate content