Module Development

Add Fields to the Vendor Content Type for Drupal 8, 9, and 10

To implement a custom vendor attendance status feature, we need to add new fields to the Vendor content type. This tutorial will guide you through adding these fields and discuss the considerations for choosing between Drupal's UI for data modeling versus code-based alterations of entity types.

In this tutorial, we'll:

  • Add new fields to the Vendor content type required for the vendor attendance status feature.
  • Discuss the pros and cons of modeling data with Drupal's Field UI compared to using hooks for modifying entity base fields.

By the end of this tutorial, you'll know how to update the Vendor content type with necessary fields and understand why this approach suits our specific case.

Drupal Module Developer Guide