Entities, Bundles, and Fields, Oh My! (Lesson 4 from DrupalEasy)

Have you ever tried to build a website prematurely? I certainly have. On my Drupal development journey, I’ve started building more websites than I care to count. Notice I said "started."

I always feel like I have this great idea and I know exactly how I want the website to look. So I install Drupal, and I’m off to the races! Then I realize I haven't taken the time to really vet out how I'd like the website to function.

Obviously, not thinking through functionality is a major problem, since planning the information architecture is probably the most crucial step in a website's building process. Attempting to go back and alter the foundation of a website after it's built is often extremely difficult--and sometimes impossible. Before starting, I need to understand Drupal's information architecture and how to use it to fit my needs.

Through my time in the Drupal Careers Online course through DrupalEasy, my eyes have been opened to the wonderful world of entities, bundles, and fields. This has been such a game changer! Drupal’s Entity API is one of the key elements that sets it apart from other CMS systems. Defining a site is so much easier once you understand the "building blocks" (ie. entities, bundles, and fields), specifically ContentEntityBase and entities that extend it. The diagram below is a simplified depiction of Drupal's core Entity base class, ContentEntityBase, and the entities that extend it.

Image

Each fieldable entity that extends ContentEntityBase has its own special features and can provide multiple types of itself, called bundles. (Users is the only entity not able to be bundled.) While this is just the tip of the iceberg in understanding Drupal's Entity API, hopefully it piqued your curiosity.

Taking the time to design your website from the ground up and having a firm understanding of entities, bundles, and fields could be the difference between simply starting a website, and actually completing one that’s functional and efficient. I’m glad to say that I’m well on my way! Happy learning, friends!

Note from Drupalize.Me trainer, Amber Matz:

Get started learning about modular content in these tutorials from Chapter 2 of the Drupal 8 User Guide.

Drupal 8, 9, 10, and 11
More information

How to plan the navigation and layout of a website (mobile and desktop browsers).

More information

Overview of content entities and fields.

Drupal 8, 9, 10, and 11
More information

Overview of modular content and how content in a page can be sourced from other content items.

And module developers, learn about Drupal's Entity API in this series of tutorials:

Add new comment

Filtered HTML

  • Web page addresses and email addresses turn into links automatically.
  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <code class> <ul type> <ol start type> <li> <dl> <dt> <dd><h3 id> <p>
  • Lines and paragraphs break automatically.

About us

Drupalize.Me is the best resource for learning Drupal online. We have an extensive library covering multiple versions of Drupal and we are the most accurate and up-to-date Drupal resource. Learn more