drupal

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 »

Telenet launches multisite search using Drupal (1)

Last year Telenet successfully migrated its knowledge base and business site to Drupal. As a member of the Ausy/DataFlow group I'm proud to announce that Telenet today launched its multisite search using Drupal.

We continued on the Apache Solr based solution we had already created for the knowledge base while Robert Douglass was hired to work on a Nutch/Solr implementation to crawl the (for now) non-Drupal based sites in the company's portfolio. This powerful combination results in a multilingual multisite search that features autocompletion, spell checking and file indexing.

Contributions were made to the following projects:

Continue reading »

Drupal Module Development training (0)

On March 15 and 16 I'll provide the follow-up training on the introductional Module Development course I gave during the Drupal Dev Days. Learn how to get custom functionality using Drupal’s hook system, as well as how to extend or alter contributed module functionality in this two-day Acquia Drupal Module Development training.

Continue reading »

Teaching at the Drupal Dev Days Brussels 2011 (0)

In the week-end of 4 to 6 February the first installment of the Drupal Developer Days will take place in Brussels. I'll provide an introductional training in Drupal 6 module development as an Acquia Training Partner for Ausy/DataFlow.

See you there!

Continue reading »

Configuring Tomcat to provide UTF-8 support for Solr (3)

When you're setting up Tomcat to run Solr be aware that although Solr supports UTF-8 by default, Tomcat does not. You can enable the character encoding by doing the following in Tomcat's server.xml:

  • Add URIEncoding="UTF-8" to the correct Connector
  • Be sure to remove useBodyEncodingForURI from that Connector
Continue reading »

What you see is not always what you get (15)

As I've mentioned before setting up a Wysiwyg in Drupal has become a straightforward job. A popular method is using the Wysiwyg module in combination with CKEditor. Enable the module, install the editor library and make sure to allow the <img> tag in your input format and you're good to go, right? Sadly, this is not always the case. It's important to note that as a security measure all input formats except the 'Full HTML' format remove all attributes from an html tag. This means that even though the image option in your favorite Wysiwyg editor allows you to align an image to the right and setting a margin, your input format will remove these attributes. Here's a clean example of CKEditor using the standard align and margin functionality:

Using the default 'Filtered HTML' input format and allow the img tag, this renders the following output:

What we saw in the Wysiwyg is definitely not what we see in the actual output because the input format removed the attributes that we set to style and position the images.

So how can we fix this? In Drupal core, we can not: the only option you have is to enable the 'Full HTML' filter, which is not advisable. Your best option is to install the Wysiwyg Filter module which enables a whole range of extra settings for input formats, allowing you to select which attributes, classes and properties should be allowed for which html tags. Such as the 'align' attribute and 'margin' property for images.

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 »
Syndicate content