2.1 Demonstrate ability to create and configure Content Types with appropriate fields and field sett

Review what a content type is and how to display content in different methods.

In Drupal, a Content Type consists of the following primary elements:

  • Content type: base configuration

  • Content type: fields

Base configuration:

The base configuration of a content type defines the default behavior and properties of the content type. Examples include whether or not a newly created item of content has the status of _published_by default; or whether or not a newly created item of content is associated with one or more menus.

Moreover, the base configuration of a content type may also permit other additional custom settings provided by add-on modules.

Fields:

Content Types permit the creation of a set of fields that are associated together in some meaningful way.

Content Types are the building blocks for structured authoring in Drupal. Content types often work in conjunction with Views, which is one way you can serve up content to your end users; you can control the content types that appear and the order in which they appear. Developers can also customize the authoring experience in the same way.

From: drupal.org/working-with-content-types-and-fields-drupal-7-and-later

Create a new Content Type

Navigate to /admin/structure/types

To manage fields click on the storage settings for each field on each content type.

configuration yml file for node.type.article.yml

uuid: 5eb519c6-4ac4-4732-a276-06d8cc71c2fd
langcode: en
status: true
dependencies: {  }
_core:
  default_config_hash: AeW1SEDgb1OTQACAWGhzvMknMYAJlcZu0jljfeU3oso
name: Article
type: article
description: 'Use <em>articles</em> for time-sensitive content like news, press releases or blog posts.'
help: ''
new_revision: true
preview_mode: 1
display_submitted: true

Create and configure fields

Navigate to: admin/structure/types/manage/article/fields

To update field configuration click on the storage settings. Below is an example of the image field on the article content type.

Navigate to: /admin/structure/types/manage/article/fields/node.article.field\_image/storage If you want to see a list of all fields on the entire site, you can also navigate to: admin/reports/fields

configuration yml file for field.field.node.article.field_image.yml

configuration yml file for field.storage.node.field_image.yml

Other Resources

Last updated