Articles

In previous articles we have seen how the Link field type works: Storage, Widget, Formatter. In this article we will make our own bone field type for outputting video from youtube on a page with two different formats and settings.
This article focuses on the Fields API, and if you need to add the Yotube video field to your site, it is better to use the ready-made module:


In this article we will consider Field Formatters, that allow us to edit the display of fields and display them on the page.
In past articles, we created field type Link, in this article we will look at how these fields are displayed on the page and which class is responsible for it. Each field that you add through Drupal can be displayed on the page and edit its settings on the page Manage display.


In this tutorial we will look at how the Field Widget of the Link module works. This is a review article, so if you want to start writing your File Widget, please skip to the following articles.
In the last lesson we added Link fields for nodes and blocks. Now let's look at what the form for the Link field is formed by.
We have already met with autoloading of PHP classes in Drupal, and there is also a WidgetBase field widget class for fields:
core/lib/Drupal/Core/Field/WidgetBase.php


In this article we will understand how fields in Drupal work, why they are needed and how fields help to quickly develop sites in Drupal.
We have already worked with fields in previous articles:


Very often access to 3rd party services must be different on dev and live instans. In order to do this with the help of configurations, you need to use the Configuration Split module:
https://www.drupal.org/project/config_split
After you enable the Config Split module, you will be able to specify the folders for the instances. Let's go to the Configuration Split settings page of the Configuration module:
/admin/config/development/configuration/config-split


When you import a configuration from one site to another, some configurations are needed to output content, but the configuration content itself does not contain any. In this tutorial, we will explain how to transfer blocks, nodes and taxonomy terms from one site to another.


Configuration in Drupal is the basis for all settings of content types, fields, configuration forms and variables. With the help of configuration we can transfer changes from one site to another, develop different features at the same time and without interfering with each other.
Configurations can be uploaded to YML files and added to the Git repository, so you can commit your changes in site settings and transfer the changes to Dev or Live. The idea of configuration in Drupal is similar to how the Features module works:


In this article we will continue to understand Form API in Drupal 8 and make a multistep form. We have already created the usual configuration form for the module, the multistep form is created in a similar way using $form_state to store data between the form steps.
Examples of code can be found at github:
https://github.com/levmyshkin/drupalbook8
For a multistep form you need to add a form class:
/modules/custom/drupalbook/src/Form/MultiStepForm.php


In one of the previous lessons we have learned what hooks are, in this lesson we will work with hook_form_alter() hooks in practice and add functionality to the existing form.
Examples of code can be found at github:
https://github.com/levmyshkin/drupalbook8
In this lesson we will start to look at hooks in practice, later on we will return to hooks and look at a couple of other examples. For now, let's start with hook_form_alter().


In this tutorial, we will deal with the Drupal Form API and create a settings form for the module. We have already created modules for displaying the page and block, let's now create a configuration form in which we will store data for connecting to a conditional service. Let's say that we need to store the API Key and the API Client ID on the site, for example, for the Google Maps API.
Code examples can be viewed on github:
https://github.com/levmyshkin/drupalbook8
