by Jeff EatonMay 7, 2012

Module Monday: Field Label Plurals

It's the little details about a web site that make you smile when you're finished building it: the subtle CSS effects, the way it intelligently pre-populates forms for you, the great organization of a complex content model, and the just-so text copy that makes things feel "right." That's why little details can be annoying, too. Take, for example, the names of multi-value FieldAPI fields on a Drupal content type. You can label a field 'Photos,' for example, but what if an editor only enters one? Somewhere, a copyeditor is grinding their molars over that one, but a convenient little Drupal module can save the day: Field Label Plurals.

Screenshot of administration screen

Setting up the module is, as one might expect, pretty straightforward: turn it on, then visit an existing FieldAPI field configuration screen. You'll see a new option just below the field's normal Label: a Single-Value label. Set up both labels to match the proper pluralization rules, and the module handles the rest.

Screenshot of resulting change to site

When a multi-value field is displayed to a site visitor, the label will change intelligently based on how many values have been added to the content item. There is a hitch, of course: in some languages, there are multiple "plural forms" of a given word rather than just one. If you plan to translate your site into one of those languages (like Arabic and Polish), this module won't be able to account for all of those forms. If you're comfortable sticking with a boring old language like English, though, Field Label Plurals can definitely add an extra bit of verbal polish.

Sign up for the Lullabot Newsletter and get our latest articles and more direct to your inbox

We can partner with you!

We’ve accomplished some amazing things for some really great clients. We’d love to talk about how we can help your next project!

Tell us about your project

You can be a ’bot!

We have an amazing team of friendly experts in a number of disciplines. We work hard, have lots of fun together, and take great care of our team.

See our open positions