how to create content type in drupal | What are the content types | Drupal 8 adding new content type

What is a content type in Drupal?

A single web site could contain many types of content, such as informational pages, news items, polls, blog posts, real estate listings, etc. In Drupal, each item of content is called a node, and each node belongs to a single content type, which defines various default settings for nodes of that type, such as whether the node is published automatically and whether comments are permitted.

When you first install Drupal with the default installation, we will have two content types defined: “Article” and “Basic page“.

Now in this article we will discuss about how to create own content type in drupal for our specific need.

Let’s start

Step 1: Login Your admin panel and Go to: Structure -> content types -> Add Content Type

Structure -> content types -> Add Content Type

Step 2: Provide name of content type here Content Pages, Description of content type description which will tell about this content type.

Content type creation configuration in drupal 9

Step 3: Here, Your content type has been created. Now you can add field for this content type as per your need. Click on Add Field.

Add Field of Content Pages

Step 4: Configure field : Select from DropDown if you want to add a new field or you can re-use an existing field.

Note: if you have already created same field as same functionality then it’s better to Re-use an existing field.

Step 5: Select field type : Here field type is Text(plain) and provide Label of that field make sure it’s machine name must be correct. It will work when we write a logic for this field.

Select Field type and machine name of field
Select Field type and machine name of field

Step 6: Configure field : Here you can limit length of created field or keep limited or unlimited add control.

Configure field
Configure field

Step 7: Configure field and provide help text for this particular field, and tell user to about this field.

Configure field and provide help text for this particular field
Configure field and provide help text for this particular field

Step 8: Field has been created.

Unique URL field has been created.
Unique URL field has been created.

Step 9: to Insert record in this new created content type: Go to Content -> Add Content -> Content Page.

Step 10: Fill your data and click on Save. Here you can perform many action. You can add select your “Text format” Basic HTML. Full HTML, Restricted HTML. as per your need.

Data entry in new created content type.
Data entry in new created content type.
Node has been created successfully.
Node has been created successfully.

Conclusion:

Hey, Friend: I hope. It’s clear now. Let know in comment section below. if there is any problem.

Pradip Mehta

I am a well-organized professional in Drupal Development and PHP web development with strong script handling knowledge or automation process with PHP. I have advanced computer skills and am a proficient multitasker.