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_imageorfield_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__imageto 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
Dan
I simply use https://www.drupal.org/project/schemadotorg
Ivan Zugec
Thanks for the tip.