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.
Step 1: Login Your admin panel and Go to: 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.
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.
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.
Step 6: Configure field : Here you can limit length of created field or keep limited or unlimited add control.
Step 7: Configure field and provide help text for this particular field, and tell user to about this field.
Step 8: 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.
Hey, Friend: I hope. It’s clear now. Let know in comment section below. if there is any problem.