Exploring Modules: Nice Menus and Rotor Banner

Drupal ExtraThis is a case study of selecting two new modules for this site. It demonstrates the process involved as well as how Drupal's architecture takes a lot of the risk out of experimentation. 

First of all, as I described in the book, there really is no substitute for a test site. It doesn't take much work to set it up, and the work itself is good practice for site maintenance that you'll need to do from time to time. For my own testing, I find it's easiest in many cases to wipe out the old test site and do a new install. Over time, I do occasional quick tweaks and tests to the test site, so when it's time to do some serious testing, getting rid of all of those makes life a bit easier.

No, a test site doesn't mean a separate server and its own URL. Having a test site on your laptop is in itself a great choice: you have it handy for clients and meetings. Creating a test site on your primary LAN (office, home, school, etc.) lets other people experiment with. If you have a hosting service that allows you multiple sites (often using add-on domains), that can be the best. Invest in a registered domain that you don't disclose (it can be a jumble of meaningless letters if you want). It's a small investment that allows you to create the greatest real-life environment. If you're using a hosting service, keep the file structure the same for your test and your production sites: that, too, can prevent grief.

Because of Drupal's modular architecture, it is rare that one module impinges on another. Here's how adding these two new modules worked.

Nice Menus

I'm of two minds about menus these days. The old interface paradigm for graphical user interfaces (select something/choose a command to act on it) is pretty creaky. More and more the commands have moved from a menu bar to the context that's right next to the affected object (possibly while holding down a control key or using an alternate mouse button). Just to make things more problematic, web-based interface can't use the true menu bar because it belongs to the browser. So we've started reimplementing commands and menu commands in our interfaces where needed.

On the NCC site, menus haven't really been needed because there are direct links and standard Drupal tools to provide functionality. But in preparing for two new books that will be published in the first half of 2010, we'll need the hierarchical control of menus, so I started shopping around.

My first stop was the consultants mailing list and its archives. The list volume is low, so it's a good way to keep an eye on what people are thinking about. You can subscribe or search the archives here.

Several people there and in other places have talked about Nice Menus. I kept track of the steps I used in evaluating a potential new module. They may or may not be useful to others.

 

  1. Go to the module page. Check usage statistics, last updates, and the bug list. These are not determinative, but they give you a sense for what's going on.
  2. If there are examples of sites using the module on the module page (hint, hint to module writers), check them out.
  3. Give it a try on your test site.

 

It seemed worthwhile (feedback and comments are welcome!), so it's now on the main site. Yes, the menu structure is spare because we haven't needed the complexity of hierarchical menus, but fortunately Drupal lets you disable menus, so the structure that's being built now will be ready to go live when the next book is published.

Rotor Banner

At the top of our site pages, I've used a custom block for links to books. It's the images and links from Amazon pasted into a custom block -- nothing Drupal, just HTML. There were some spacing issues that annoyed me, and I started fiddling around. The HTML originated with Amazon's generated code, and it was very table-rich and fragile. What, I thought, would happen if I used some kind of standard rotating banner? For one thing, it would mean that I could prepare each link and image separately (in Photoshop), and wouldn't have to do any rearranging if I had 5 books or 7 books in the banner: each one is shown in sequence.

I've found the most valuable tool for finding and choosing modules is Comparison of Contributed Modules. Unlike the menu choice where I let a posting in the consultants list spur my thoughts, here I knew that I wanted to find a module, so this comparison center is a great tool. Their tables of functionality let you compare modules, even though not all of them have been evaluated. I often take the easy way out: if one or two modules have what I want, I focus on them even if other modules haven't yet been evaluated and might serve the purpose with additional research.

Rotor Banner seemed to do the trick; the download and install on test and then production sites took just over an hour (and that includes the Photoshop prep of the images).

In more traditional environments, I would be tempted to do at least one end-to-end test to make certain that nothing has accidentally been broken, but with Drupal, the modular architecture generally makes this unnecessary. However, if you are dealing with a module that creates or acts upon data from another module, make certain that you can get your data into and out of the new format.