The most useful features of Durapal 7 / Drupal 8 is custom content types. Using Drupal 7 / Drupal 8, anyone can build any type of custom type of contents. Now, you may think why custom type contents are required? Pretty simple, think about the employee information page and employee salary information page. Both page does not contain equal type of data. That's why custom type of contents are required. Drupal 8 / Drupal 7 provides this type of flexiblity for all Drupal lover. This facility is actually known as CCK i.e. Content Construction Kit. Using the build in CCK feature of Druapl 7 / Drupal 8, anyone can easily create customize content type for his / her website. This page gives you a basic idea about building a custom content page according to your choice using Drupal 7 / Drupal 8.
Requirements:
- Drupal Installed website (Drupal 7 / Drupal 8)
Extra Modules:
- No extra module is required.
Steps to to create / define custom types of content in Drupal 7 / Drupal 8:
Follow the following steps to create / define custom types of content in Drupal 7 / Drupal 8:
Step 1: Log in to your Drupal 8 / Drupal 7 website admin control panel using your website user name and password.
Step 2: After successful logged in, click on Structure option from the admin control panel of Drupal 7 / Drupal 8.
Step 3: From the “Structure” window, choose Content types. Contents types is required for manage content types, including default status, front page promotion, comment settings, etc. But our primary goal is to create a custom content type. So, we have to choose this.
Step 4: A list of available content types will be appeared in the “Content types” page. Our aim is to create a new content type. So, we choose Add content type and click on that option.
Step 5: We have to complete the two fields that give the content type its identity: [1] the Name field & [2] Description field.
In the Name field we will type the “human-readable” name of the content type & Drupal 7 / Drupal 8 will automatically create a “machine name” that converts spaces to underscores, and uppercase characters to lowercase characters.
Note: If you wish, you could change the machine name according to your wish by clicking the Edit link.
Description field is an optional field and just type some explanatory text that appears on the “Add new content” page to help content editors select the right content type to create and publish.
For example, we would create a content type for Employee information. So, we type Employee in the “Name” filed and type Employee information page in the “Description” filed.
Step 6: At last, click on Save and add fields button to save this content type and add fields to this content type.
Step 7: After completing the above steps, we are ready to add new fields to our content type. Drupal 8 / Drupal 7 supports several type build-in data fields: Boolean, Decimal, File, Float, Image, Integer, List (float), List (integer), List (text),Long text, Long text and summary, Text. You have to choose according to your requirements.
To add any fields for your content type, you just have to add a new field by typing a Label to the Add new field textbox, choose a data type of to store from the Select a field type drop down option and finally you have to choose a widget. After doing this, click on Save button and do the next steps as you like.
For example, for our employee information, we need a field like Nick name of each employee. So, we have to add a new field. We choose Nick name as level, text as data type and text field as widget type and click on Save button and do the next steps.
By following the above steps, you can add any type of data field for your content type. Hope, it’s simple and easy. Thus anyone of any Drupal 7 / Drupal 8 admin, can create any type of content and add fields according to content type requirements.