Creating a custom content type in Drupal 8

This page appears to be a duplicate of Include default configuration in your Drupal 8 module. It should be considered for deprecation.

Creating a custom content type became quite easy, thanks to the new Configuration API that comes with Drupal 8.

Relying Party and Provider Configuration

Usually there are two parts involved when it comes to OpenID Configuration.
On one side, there's a provider which handles the user login process and on the other side, we have a relying party, where the user also wants to be logged in.

Module Configuration

The Message module provides a user interface for configuration at /admin/config/system/message. There are three main areas of configuration. First, you can set an expiry date on messages so that messages older than a certain number of days are purged from the database. Second, there is a utility for copying text fields from one language to another (see second screenshot below). This makes it easier to create multilingual message text fields. Third, you can use the DrupalQueue for batch processing (and deleting) messages that do not have a reference to another entity.

Configuration Storage in Drupal 8

By default, configuration information in Drupal 8 is stored in the database.

Configuration File Format (YAML)

All configuration data is stored on-disk using YAML files.

Here is an example of a configuration file:

some_string: 'Woo kittens!'
some_int: 42
some_bool: true

Configuration can also be nested. Here is an example:

name: thumbnail
label: 'Thumbnail (100x100)'
    id: image_scale
      width: 100
      height: 100
      upscale: true
    weight: 0
    uuid: 1cfec298-8620-4749-b100-ccb6c4500779

Configuration Schema

Configuration has a schema. This is described in

Configuration File Location for a Site

By default, when you install Drupal, the installer will create a randomly-named directory inside your public files directory for configuration. The name will start with 'config_', followed by a random hash string. Within this directory, the installer will create an 'active' directory for your current live configuration, and a 'staging' directory for configuration you are importing.

You can change the locations of your staging and active directories by editing your settings.php file.

Default Configuration for an extension

Optional Configuration for an extension

OpenAid Hero

When a Hero comes along, with the strength to carry on.

Enabling the Hero feature adds a block to your homepage where you can add a statement or paragraph to highlight your organization. It is a free text area with a button linking to another page or site.

Screenshot of the Hero block

To enable the feature, check the box next to OpenAid Hero feature. Then scroll to the bottom of the screen and click Save settings.


Subscribe with RSS Subscribe to RSS - configuration