
Drupal 10 Development Cookbook
By :

Drupal excels in the realm of content management by allowing different types of content. In this recipe, we will walk you through creating a custom content type. We will create a Services type that has some basic fields and can be used in a scenario that brings attention to a company’s provided services.
You will also learn how to add fields to a content type in this recipe, which generally goes hand in hand with making a new content type on a Drupal site.
Services
as the name, and an optional description.Important note
The Text (plain) option is a regular text field. The Text (formatted) option will allow you to use text formats on the displayed text in the field.
In Drupal, content entities can have different bundles. A bundle refers to a different type of that entity type. The word bundle comes from it being a bundle of fields since each bundle of a content entity type can have different fields. When working with nodes, they are synonymous with content, and bundles for nodes are referred to as content types.
When a content type is created, a default body field is created for it. This is performed by calling the node_add_body_field()
function in the node.module
file. It is a great reference point for those who wish to see the steps for programmatically defining a bundle field outside of the user interface.
Fields can only be managed or added if the Field UI
module is enabled. The Field UI
module exposes the Manage Fields, Manage Form Display, and Manage Display options for entities, such as Nodes, Blocks, and Taxonomy Terms.