Skip to main content

Custom add another

An article from ComputerMinds - Building with Drupal in the UK since 2005
6th Mar 2012

Steven Jones

Senior Developer
Hey, you seem to look at this article a lot! Why not Bookmark this article so you can find it easily in the future?

Drupal 7 fields are great, but using multiple valued fields and field collection you can quickly reach the point of having a form that looks like this:

A complex field collection form

In this contrived example I've got two field collections and a multi-valued 'Links' field within that.

Although it's reasonably clear what clicking 'Add another item' will do in each case, when the form is full of data it can become less so.

We can give content editors a helping hand by changing the buttons from 'Add another item', to something more useful like 'Add another carousel item' etc. With the Custom add another module we can do just that. We can make that form look like this:

A complex field collection form with customised butons

Now it's much clearer what clicking on one of those buttons will do.

Hi, thanks for reading

ComputerMinds are the UK’s Drupal specialists with offices in Bristol and Coventry. We offer a range of Drupal services including Consultancy, Development, Training and Support. Whatever your Drupal problem, we can help.