Opens in a new tab

How do you name fields in Drupal?

Don’t forget to subscribe to our YouTube channel to stay up-to-date.

How do you name your fields in Drupal?

I’m curious what patterns other developers follow.

The main questions always seem to be:

  • Singular or plural? Do you use field_image or field_images, even for single-value fields?
  • Content type prefix? Do you add the content type, like field_event_image?
  • Abbreviations? Do you have to abbreviate, like field_ev_image, to stay under the character limit?
  • Double underscores? I’ve also seen patterns like field_event__image to separate the bundle.

It’s a simple problem that never seems to have one perfect answer.

Do you have a different method or a firm rule your team follows? I’d like to hear what works for you.

2 comments

Leave your comment

✦ WebWash Premium

Go deeper with Premium

Lifetime access to every premium course, the private member forum and member-only live streams.

16+ in-depth courses
Private member forum
Member-only live streams
Ad-free, forever
Get lifetime access · €99

One-time payment · plus VAT