Custom Drupal Module: Hierarchical Select Accordion Field Formatter

A popular saying within the Drupal community goes: There's a module for that! It implies that whatever functionality and features you may think of, most likely, someone has already created a module that implements it. So most times your main challenge is in discovering it.

The Background

Some times the contributed modules you discover will give you the desired functionality, right out of the box. Some other times, the module may not match exactly your requirements. In such a case you may wish that you could, somehow, 'bend' the contributed module to suit your exact use case. And there lies one of the beauties of Drupal.

Unless you are familiar with Drupal principles, your first thought would be to re-create the solution to fit your use case. In most cases, you don't need to. One of the core philosophies of the Drupal architecture is extensibility.

In Drupal almost everything is extensible. This means that you can alter only the part that requires changing, in a standardized way. Thus avoiding recreating the whole functionality.

This capacity of a Drupal module is not automatic, it has be carefully planned for and build into the module. This is a hallmark of a top class contributed module, the kind of module you would want to be using all the times.

The Challenges

The above is the backdrop agaist which this projects activities played out. The client (a fellow Drupal site builder) had added a feature on his client's website that uses the Hierarchical Select contributed module. His client then requested that the output of the feature be displayed as an accordion.

This was not possible with the contributed module out-of-the-box.

The developer consulted us, requesting that we customize the Hierarchical Select module to achieve this goal.

Our Solution

We analyzed the Hierarchical Select module's codes and discovered that it is extensible. The implication was that we would not need to customized the module to get the functionality we need.

We simply needed to extended it following the Drupal best practices and standards.

The End Result

The end result was a custom Drupal module we called Hierarchical Select Accordion Field Formatter. As the name implies, it adds a formatting extension that would display the Hierarchical Select module's output as an accordion.

The desired solution was delivered to the client at a much lower cost of time, effort and money.

A big win for choosing a Drupal-based solution.

Drupal Module Development